Skip to content

Commit 019fbb1

Browse files
committed
2 parents b67f358 + b38109c commit 019fbb1

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
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/static/directory.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ async function refresh_list() {
6363
var icon = "⬇";
6464
var file_path = current_path + f.name;
6565
let api_url = new URL("/fs" + file_path, url_base);
66+
let edit_url = "/edit/#" + file_path;
6667
if (f.directory) {
6768
file_path = "#" + file_path + "/";
6869
api_url += "/";
@@ -91,7 +92,7 @@ async function refresh_list() {
9192
delete_button.disabled = !editable;
9293
delete_button.onclick = del;
9394

94-
let edit_url = new URL("/edit/#" + f.name, url_base);
95+
edit_url = new URL(edit_url, url_base);
9596
let edit_link = clone.querySelector(".edit_link");
9697
edit_link.href = edit_url
9798

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)