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

[Bug] SPARQL access to queryid header leads failed search #393

Closed
JervenBolleman opened this issue May 14, 2024 · 7 comments · Fixed by #395
Closed

[Bug] SPARQL access to queryid header leads failed search #393

JervenBolleman opened this issue May 14, 2024 · 7 comments · Fixed by #395
Assignees
Labels
bug Something isn't working

Comments

@JervenBolleman
Copy link

JervenBolleman commented May 14, 2024

Description

Attempting to run graph-explorer on a sparql endpoint specifically https://beta.sparql.swisslipids.org fails in firefox due to an

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://beta.sparql.swisslipids.org/sparql. (Reason: header ‘queryid’ is not allowed according to header ‘Access-Control-Allow-Headers’ from CORS preflight response)

queryid is not a standard header and the code should expect that no access is possible.

Environment

  • OS: Rocky Linux 9+
  • Browser:firefox 115.10
  • Graph Explorer Version: git commit 4f740ec
  • Graph Database & Version: RDF4j native, with a custom frontend

Steps to Reproduce

Add a database https://beta.sparql.swisslipds.org sync, and then open the explorer for the dataset /explorer/#/graph-explorer
search for "15-methylhexadecasphinganine" see failure message red box and CORS failures in the firefox console.

Expected Behavior

A successful search


Important

If you are interested in working on this issue or have submitted a pull request, please leave a comment.
The queryid is an interesting header to add, so I will add this to our endpoints and reproducing this in the future might be hard.

I am trying to have a look at the code to see if I can suggest a patch.

@JervenBolleman JervenBolleman added the bug Something isn't working label May 14, 2024
@JervenBolleman
Copy link
Author

I am trying to have a look at the code to see if I can suggest a patch.

@kmcginnes kmcginnes self-assigned this May 14, 2024
@kmcginnes
Copy link
Collaborator

kmcginnes commented May 14, 2024

Possibly related

@kmcginnes
Copy link
Collaborator

@JervenBolleman Can you try using Graph Explorer with the proxy server?

You can refer to the notes in this comment for some basic instructions:

#364 (comment)

@kmcginnes
Copy link
Collaborator

ok, I was able to get https://beta.sparql.swisslipids.org/ working locally with the proxy server. It did require some code changes around how the proxy server is constructing the request. The big one was adding the Accept: 'application/json' to the header.

@kmcginnes
Copy link
Collaborator

@JervenBolleman Can you try my branch and configuration settings to see if it works for you?

@kmcginnes
Copy link
Collaborator

I'm sorry, I closed this prematurely.

@kmcginnes kmcginnes reopened this May 14, 2024
@JervenBolleman
Copy link
Author

@kmcginnes thank you. This works nicely with the proxy. I am still going to make this work without the proxy out of the box by adding the expected required headers to our endpoints.
graph-1715931789225

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants