mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-03-01 11:19:52 +03:00
"Method PUT is not allowed by Access-Control-Allow-Methods" #424
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mikkelnl on GitHub (Sep 21, 2019).
Getting the following error when trying to save an edit in the Bitwarden Safari extension 1.42.0, after updating Safari to 13.0, running bitwarden_rs 1.10.0-4c07f05b:
"Method PUT is not allowed by Access-Control-Allow-Methods"
@rotx commented on GitHub (Sep 23, 2019):
This happens when you edit and save an item in the extension.
For me, the following quick change seems to fix it (this is inspired by the original code using "AllowAnyMethod()"):
@vplme commented on GitHub (Sep 23, 2019):
Sorry for this issue. I didn't test it with editing the items.
Does https://github.com/dani-garcia/bitwarden_rs/pull/631 fix the issue?
It seems to work for me.
@Ayitaka commented on GitHub (Sep 24, 2019):
Same empty strings with latest build:
{"Response headers (985 B)":{"headers":[{"name":"access-control-allow-credentials","value":"true"},{"name":"access-control-allow-headers","value":""},{"name":"access-control-allow-methods","value":""},{"name":"access-control-allow-origin","value":""},{"name":"cache-control","value":"no-cache, no-store, max-age=0"}...
Edit: Do you need to set the "Access-Control-Allow-Methods" in req_headers to be "GET, POST, PUT, DELETE" somewhere?
@vplme commented on GitHub (Sep 24, 2019):
I'm adding the headers in the preflight request. When I use
mitmwebit does give me the correct OPTIONS and PUT request+response and both of them work. Extension also seems to work.How did you get your response snippet? From Safari with the extension? What was the request?
@Ayitaka commented on GitHub (Sep 24, 2019):
Never mind. Upon further reading, the extension is different from web in terms of CORS I guess, sorry.
I left my web responses in the original edit of this comment, but those are from the web interface, not extension.
@seanfarley commented on GitHub (Oct 1, 2019):
Just wanted to report that #631 doesn't work for editing or deleting an item in the browser extension.
@vplme commented on GitHub (Oct 1, 2019):
I got an error trying to delete an item but editing does seem to work for me. What error did you get?
Error while trying to delete:

Returning the exact
OriginasAccess-Control-Allow-Originseems ok and matches the official api except when theOriginisfile://it seems incorrect and it should return*. The .NET Core CORS Middleware seems to do this logic.Also, it's currently adding all the CORS headers to all requests while it should only be the preflight (OPTIONS) request.
Could you check if https://github.com/dani-garcia/bitwarden_rs/pull/639 fixes things for you?
@seanfarley commented on GitHub (Oct 1, 2019):
Ah, cool! Let me check it out and test it.