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

Support POST with raw query as body #14

Open
benjay10 opened this issue Nov 7, 2022 · 0 comments
Open

Support POST with raw query as body #14

benjay10 opened this issue Nov 7, 2022 · 0 comments

Comments

@benjay10
Copy link

benjay10 commented Nov 7, 2022

According to the SPARQL 1.1 Protocol, sending a POST request with header Content-Type: application/sparql-query and the SPARQL query as the raw body string should be a supported method. This does not work and fails with the following error log:

Incoming SPARQL query:

[error] GenServer #PID<0.451.0> terminating
** (FunctionClauseError) no function clause matching in String.Break.trim_leading/1
    (elixir) lib/elixir/unicode/properties.ex:288: String.Break.trim_leading(nil)
    (elixir) lib/string.ex:1108: String.trim/1
    (mu-authorization) lib/sparql_server/router/handler_support.ex:100: SparqlServer.Router.HandlerSupport.handle_query_with_template_local_store/4
    (mu-authorization) lib/sparql_server/router/handler_worker.ex:19: SparqlServer.Router.Handler.Worker.handle_call/3
    (stdlib) gen_server.erl:661: :gen_server.try_handle_call/4
    (stdlib) gen_server.erl:690: :gen_server.handle_msg/6
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
...

Is this because mu-authorization is assuming the POST request's content is always x-www-form-urlencoded?

Expected outcome:

This service should follow the official specification and should at least support all of the described methods. Many clients might follow the official specification and be surprised some of it is not supported, especially since the real supported API is not documented for mu-authorization. A small bit of documentation might also be nice to let clients understand which methods are supported, even if it is supporting the full specification.

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

No branches or pull requests

1 participant