You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some users might use regular browsers(chrome, firefox, etc) to explore and make quick tests of the API, but since the addition of #1330 this is no longer possible:
GET /projects
{"message":"text/html requested but a single column was not selected"}
This would also have happened for chrome if #1077 was implemented, since this is the Accept header that it sends by default:
Having pgrst behave like this by default is bad for UX. So we shouldn't have image/* or text/html as alias for binary output by default. Though I think text/plain is probably safe.
Allowing Content-Type overriding isn't a solution since that doesn't make pgrst do raw output.
Proposal
My proposal for now would be to add a new config option that lets the user specify the media types for which it would like the raw output and not have text/html by default. Something like:
@Dansvidania Actually the use case for text/html was just for pg functions that returned text. It was a mistake on my part to enable it by default for all kind of binary outputs. Getting an html column wasn't intended(although getting an image/png column was the intention in #1077)
So the idea as I proposed is to remove text/html from here:
PostgREST version: v6.0.0
Problem
Some users might use regular browsers(chrome, firefox, etc) to explore and make quick tests of the API, but since the addition of #1330 this is no longer possible:
This would also have happened for chrome if #1077 was implemented, since this is the
Accept
header that it sends by default:(See the
image/webp
andimage/apng
in there)Having pgrst behave like this by default is bad for UX. So we shouldn't have
image/*
ortext/html
as alias for binary output by default. Though I thinktext/plain
is probably safe.Allowing
Content-Type
overriding isn't a solution since that doesn't make pgrst do raw output.Proposal
My proposal for now would be to add a new config option that lets the user specify the media types for which it would like the raw output and not have
text/html
by default. Something like:raw-output-media-types = [ "image/png", "image/jpeg", "text/html" ]
This would solve this issue and #1077.
The text was updated successfully, but these errors were encountered: