Informatievlaanderen / VSDS-LDESServer4J

Linked Data Event Streams Server for Java
https://informatievlaanderen.github.io/VSDS-LDESServer4J
European Union Public License 1.2
8 stars 8 forks source link

Response of /admin/api/v1/eventstreams (and other endpoints) returns incorrect Content-Type (text/html) #1210

Closed rorlic closed 3 months ago

rorlic commented 4 months ago

When requesting /admin/api/v1/eventstreams using a browser (which sends header Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7) the server returns Content-type: text/html instead of a RDF type.

The following endpoints have the same behavior:

Requesting the following endpoint correctly returns a RDF type (Content-type: application/ld+json):

rorlic commented 4 months ago

Same behavior can be seen using curl:

Incorrect:

$ curl -I http://localhost:9003/ldes/admin/api/v1/dcat -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,
image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"
HTTP/1.1 200 
Content-Type: text/html
Transfer-Encoding: chunked
Date: Thu, 21 Mar 2024 10:10:56 GMT

$ curl -I http://localhost:9003/ldes/admin/api/v1/eventstreams -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"
HTTP/1.1 200 
Content-Type: text/html
Transfer-Encoding: chunked
Date: Thu, 21 Mar 2024 10:11:02 GMT

$ curl -I http://localhost:9003/ldes/admin/api/v1/eventstreams/boorgat -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"
HTTP/1.1 200 
Content-Type: text/html
Transfer-Encoding: chunked
Date: Thu, 21 Mar 2024 10:11:06 GMT

$ curl -I http://localhost:9003/ldes/admin/api/v1/eventstreams/boorgat/shape -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"
HTTP/1.1 200 
Content-Type: text/html
Transfer-Encoding: chunked
Date: Thu, 21 Mar 2024 10:11:24 GMT

Correct:

$ curl -I http://localhost:9003/ldes/admin/api/v1/eventstreams/boorgat/views -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"
HTTP/1.1 200 
Content-Type: application/ld+json
Transfer-Encoding: chunked
Date: Thu, 21 Mar 2024 10:11:12 GMT

$ curl -I http://localhost:9003/ldes/admin/api/v1/eventstreams/boorgat/views/by-page -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"
HTTP/1.1 200 
Content-Type: application/ld+json
Transfer-Encoding: chunked
Date: Thu, 21 Mar 2024 10:11:17 GMT