Skip to content

Add response.headers GUC for GET/POST/PATCH/PUT/DELETE #1435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 21, 2020

Conversation

steve-chavez
Copy link
Member

@steve-chavez steve-chavez commented Jan 15, 2020

@steve-chavez steve-chavez marked this pull request as ready for review January 17, 2020 23:02
@steve-chavez
Copy link
Member Author

Added the ability to override all postgrest provided headers.

@steve-chavez
Copy link
Member Author

steve-chavez commented Jan 18, 2020

I remember we got a question in gitter chat regarding setting the http status through a response.status GUC, can't find it though. We currently support setting status through raise http://postgrest.org/en/v6.0/api.html#errors-and-http-status-codes, though that's more meant for errors and will cancel the body pgrst generates.

Should we allow overriding the http status for successful responses as well? This would make our feature set for customizable http logic complete.

Setting the response.status GUC also seems more intuitive than setting the sqlstate to our special PT*** code.

@steve-chavez
Copy link
Member Author

I'll leave response.status for another time. Raising the PT*** error should be enough for most use cases.

I think this is good to merge now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant