Merge pull request #6807 from makermelissa/main

Allow Move/Rename to be called from localhost
This commit is contained in:
Mark 2022-08-24 20:52:37 -05:00 committed by GitHub
commit aaf96653ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 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. 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: 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", "HTTP/1.1 204 No Content\r\n",
"Content-Length: 0\r\n", "Content-Length: 0\r\n",
"Access-Control-Expose-Headers: Access-Control-Allow-Methods\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); "Access-Control-Allow-Methods:GET, OPTIONS", NULL);
if (!_usb_active()) { if (!_usb_active()) {
_send_str(socket, ", PUT, DELETE"); _send_str(socket, ", PUT, DELETE, MOVE");
#if CIRCUITPY_USB_MSC #if CIRCUITPY_USB_MSC
usb_msc_unlock(); usb_msc_unlock();
#endif #endif