-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad request on authed PATCH request. #1441
Comments
Hi @Falx, unfortunately I'm unable to reproduce this - could you provide some more info? I'm not too familiar with CSS, but after cloning that repo, running That said, I expect this to be an issue in CSS, so I've subscribed to CommunitySolidServer/CommunitySolidServer#777 as well. Edit 2: although it's interesting that your request body contains undefined prefixes (e.g. |
I did look into that, I just simplified it to a body that works without the library. I'll try to get a reproducer project going. |
If you clone this repo, you should be able to reproduce it. I used a test account on solidcommunity instead of the CSS, since I believe the issue is unrelated to the CSS. https://github.com/Falx/patch-test Steps are in the readme. |
Thanks for the detailed reproduction, and verifying that it also happens against other servers, that really helps. I think I've identified the problem, and it's somewhat silly: the CORS requests asks the server to allow it to send a Could you verify whether that resolves your issue? |
Really? I tried that before 🤔? Must not have been thorough in testing that. It does seems to work indeed, thanks! On a side note: The 'PUT' request is also lowercase and does succeed. |
Yeah, that's a weird inconsistency that you're not the first to trip over. See:
Thanks for reporting back! |
Impacted package
Which packages do you think might be impacted by the bug ?
Bug description
I am using the
@inrupt/solid-client-authn-browser
library to authenticate (successfuly) and do aPATCH
request to my webId using the returnedfetch
. I always get a CORS error, which is the result of a400 Bad Request
without any headers.If I do the same request with a http client copying the DPoP token and Authorization header though, that request succeeds.
To Reproduce
https://github.com/solid/community-server.git
andnpm start
login()
function withhttp://localhost:3000
asoidcIssuer
fetch
function and do aPATCH
request:application/sparql-update
http://localhost:3000/{podName}/profile/card
INSERT DATA { <ex:s> <ex:p> <ex:o> }
Expected result
The PATCH should succeed. (HTTP 205)
Actual result
CORS error in browser because of header-less 400 Bad Request
Environment
The text was updated successfully, but these errors were encountered: