phenoscape / owlery

Owlery is a set of REST web services which allow querying of an OWL reasoner containing a configured set of ontologies.
MIT License
16 stars 11 forks source link

Possible issue in Owlery header parsing #169

Closed rpgoldman closed 2 years ago

rpgoldman commented 3 years ago

I have used openapi-generator to build a python client for Owlery from the Swagger/OpenAPI spec.

Trying to debug this, I found the following in my Owlery log:

[INFO] [10/07/2021 18:23:44.588] [Main-akka.actor.default-dispatcher-80] [akka.actor.ActorSystemImpl(Main)] Response for
  Request : HttpRequest(HttpMethod(GET),http://localhost:8080/kbs/sd2e-container-catalogs/instances?prefixes=%7B%22cont%22%3A+%22https%3A%2F%2Fsift.net%2Fcontainer-ontology%2Fcontainer-ontology%23%22%2C+%22om%22%3A+%22http%3A%2F%2Fwww.ontology-of-units-of-measure.org%2Fresource%2Fom-2%2F%22%7D&direct=False&includeDeprecated=True&object=cont%3AClearPlate+and+%0A+++++cont%3ASLAS-4-2004+and%0A+++++%28cont%3AwellVolume+some+%0A++++++++%28%28om%3AhasUnit+value+om%3Amicrolitre%29+and%0A+++++++++%28om%3AhasNumericalValue+only+xsd%3Adecimal%5B%3E%3D+%22200%22%5E%5Exsd%3Adecimal%5D%29%29%29+and%0A+++++%28cont%3AhasWellBottomShape+only+cont%3ANotFlatWellBottom%29,List(Timeout-Access: <function1>, Host, Accept-Encoding: identity, Accept: application/json, user-agent: OpenAPI-Generator/1.0.0/python),HttpEntity.Strict(none/none,0 bytes total),HttpProtocol(HTTP/1.1))
  Response: Complete(HttpResponse(200 OK,List(),HttpEntity.Strict(application/json,885 bytes total),HttpProtocol(HTTP/1.1)))
[DEBUG] [10/07/2021 18:24:27.601] [Main-akka.actor.internal-dispatcher-83] [akka://Main/system/IO-TCP/selectors/$a/0] New connection accepted
[WARN] [10/07/2021 18:24:27.615] [Main-akka.actor.default-dispatcher-76] [akka.actor.ActorSystemImpl(Main)] Illegal header: Illegal 'user-agent' header: Invalid input '/', expected OWS, 'EOI', tchar, product-or-comment or comment (line 1, column 24): OpenAPI-Generator/1.0.0/python
                       ^

I think that "OpenAPI-Generator/1.0.0/python" is actually a legit User agent header value, but the spec is kind of opaque. This looks like it might be an issue with the library that Owlery uses, rather than Owlery itself.

I don't believe that this warning would cause incorrect processing of a request, would it? I'm getting back empty responses here, but that could be a problem with the client, rather than Owlery.

rpgoldman commented 2 years ago

Quick follow-up: when I fixed my client, it works fine. So this does not seem to cause incorrect responses.

This issue could probably be closed (I don't think it's my place to do so, but please feel free to); possibly you would like to pass it on to whatever upstream is.

balhoff commented 2 years ago

@rpgoldman I don't fully understand what the right behavior is here, but since it's working for you, I'll go ahead and close.