Skip to content

Commit 063e168

Browse files
committed
Add Authorization to Allow-Headers in web workflow
Makes Safari happy
1 parent 8b2f061 commit 063e168

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/workflows.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ CIRCUITPY_WIFI_SSID='scottswifi'
8282
CIRCUITPY_WIFI_PASSWORD='secretpassword'
8383

8484
# To enable modifying files from the web. Change this too!
85+
# Leave the User field blank in the browser.
8586
CIRCUITPY_WEB_API_PASSWORD='passw0rd'
8687

8788
CIRCUITPY_WEB_API_PORT=80
@@ -121,7 +122,7 @@ The web server will allow requests from `cpy-XXXXXX.local`, `127.0.0.1`, the dev
121122
### File REST API
122123
All file system related APIs are protected by HTTP basic authentication. It is *NOT* secure but will
123124
hopefully prevent some griefing in shared settings. The password is sent unencrypted so do not reuse
124-
a password with something important.
125+
a password with something important. The user field is left blank.
125126

126127
The password is taken from `/.env` with the key `CIRCUITPY_WEB_API_PASSWORD`. If this is unset, the
127128
server will respond with `403 Forbidden`. When a password is set, but not provided in a request, it

supervisor/shared/web_workflow/web_workflow.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ static void _reply_access_control(socketpool_socket_obj_t *socket, _request *req
492492
"HTTP/1.1 204 No Content\r\n",
493493
"Content-Length: 0\r\n",
494494
"Access-Control-Expose-Headers: Access-Control-Allow-Methods\r\n",
495-
"Access-Control-Allow-Headers: X-Timestamp, Content-Type\r\n",
495+
"Access-Control-Allow-Headers: X-Timestamp, Content-Type, Authorization\r\n",
496496
"Access-Control-Allow-Methods:GET, OPTIONS", NULL);
497497
if (!_usb_active()) {
498498
_send_str(socket, ", PUT, DELETE");

0 commit comments

Comments
 (0)