zazuko / trifid

Lightweight Linked Data Server and Proxy
Apache License 2.0
80 stars 11 forks source link

mime-type `n-triples` isn't compressed #472

Closed Rdataflow closed 2 months ago

Rdataflow commented 2 months ago

repro steps

curl -v 'https://test.ld.admin.ch/query' -X POST -H 'Accept: application/n-quads' -H 'Accept-Language: de,en-US;q=0.7,en;q=0.3' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Content-Type: application/x-www-form-urlencoded' --data-raw 'query=CONSTRUCT%20%7B%20%3Fsub%20%3Fpred%20%3Fobj%20.%20%7D%20%0AWHERE%20%7B%0A%20%20%3Fsub%20%3Fpred%20%3Fobj%20.%0A%7D%20LIMIT%201000' > /dev/null

expected response header with content-encoding: gzip

ludovicm67 commented 2 months ago

@Rdataflow Thank you for the bug report and the PR. I will take a look 👍

Rdataflow commented 2 months ago

I just went through all of the YASGUI dropdown format options for a SELECT and a CONSTRUCT to check if something doesn't compress. Feel free to add or alter whatever seems best to you :+1:

ludovicm67 commented 2 months ago

From all the test I did, the application/sparql-results+json; charset=utf-8 was not able to work anymore with your changes. I added a commit to add support for parameterized content-types to solve the issue 😄