Skip to content

Support POST with raw query as body #14

@benjay10

Description

@benjay10

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions