Closed josephmturner closed 1 year ago
Perhaps we could add a dummy file inside of the special folder, like hyper://public-key/$/writable
. HEAD
requests to that url would return status 200
(204
?) if the session is writable or 403
if not.
Generally in the past I did this by setting the allowed methods header in the HEAD request.
Maybe we can add the Allow
header in any requests which can contain PUT/POST
to.
That way one can check if a given drive is writable by doing a HEAD
on the root, then checking if the headers.Allow
list contains PUT
.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Allow
Also down to have a proper error code returned if one does a PUT on a non writable drive.
Thinking of using 405 for saying "You can't POST here".
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405
Besides attempting to write or delete a file from a hyperdrive, is there a way to check that a drive is writable?