Allow Move/Rename to be called from localhost

This commit is contained in:
Melissa LeBlanc-Williams 2022-08-24 14:50:42 -07:00
parent b481411541
commit 1ae4d881fd
2 changed files with 3 additions and 3 deletions

View File

@ -138,7 +138,7 @@ root will be returned.
When requested with the `OPTIONS` method, the server will respond with CORS related headers. Most
aren't needed for API use. They are there for the web browser.
* `Access-Control-Allow-Methods` - Varies with USB state. `GET, OPTIONS` when USB is active. `GET, OPTIONS, PUT, DELETE` otherwise.
* `Access-Control-Allow-Methods` - Varies with USB state. `GET, OPTIONS` when USB is active. `GET, OPTIONS, PUT, DELETE, MOVE` otherwise.
Example:

View File

@ -511,10 +511,10 @@ static void _reply_access_control(socketpool_socket_obj_t *socket, _request *req
"HTTP/1.1 204 No Content\r\n",
"Content-Length: 0\r\n",
"Access-Control-Expose-Headers: Access-Control-Allow-Methods\r\n",
"Access-Control-Allow-Headers: X-Timestamp, Content-Type, Authorization\r\n",
"Access-Control-Allow-Headers: X-Timestamp, X-Destination, Content-Type, Authorization\r\n",
"Access-Control-Allow-Methods:GET, OPTIONS", NULL);
if (!_usb_active()) {
_send_str(socket, ", PUT, DELETE");
_send_str(socket, ", PUT, DELETE, MOVE");
#if CIRCUITPY_USB_MSC
usb_msc_unlock();
#endif