Skip to content
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

Handle error when Origin header value is not IRI #1738

Conversation

csarven
Copy link
Member

@csarven csarven commented Sep 4, 2023

Server breaks when Origin header value is not an IRI. See:

this.agentOrigin = options.strictOrigin && options.agentOrigin ? rdf.sym(options.agentOrigin) : null

calling rdf.sym where an Error is thrown but it is not caught.

Following examples typically return 200:

$ curl -i https://example.org/
$ curl -iH 'Origin: https://example.net' https://example.org/

Following examples breaks the script (bin/solid.js). 500 returned.

$ curl -iH 'Origin: null' https://example.org/
$ curl -iH 'Origin: breaking bad' https://example.org/

There may be a better way to fix this issue than what's in this PR but I'll leave it in the hands of folks that can do better.

@csarven csarven force-pushed the fix/acl-checker/origin-non-iri-error-handling branch from f85a4bc to 401d5f2 Compare September 4, 2023 14:25
Copy link
Contributor

@ewingson ewingson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bourgeoa bourgeoa changed the base branch from main to csarvenfix/acl-checker/origin-non-iri-error-handling October 20, 2023 15:12
@bourgeoa bourgeoa merged commit 72a3a69 into nodeSolidServer:csarvenfix/acl-checker/origin-non-iri-error-handling Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants