hasura / hasura/graphql-engine
Accept Language Header doesn't forward to webhooks.
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
### Version Information
Server Version: v2.19.0
### Environment
OSS
### What is the current behaviour?
I have created a nest.js endpoint that's listening after a specific header 'Accept-Language', this endpoint is a GET endpoint and I have created a hasura action that forwards a client request to my nest.js endpoint, everything is working as expected except for the fact that hasura 'scrubs' the Accept-Language header from any requests made thus breaking the whole I18N functionality of my nest.js service.
I've also tried to 'whitelist' the accept language header by adding this to the config.yaml of hasura:
graphql:
server:
forwarded_headers:
- Accept-Language
But this did nothing.
### What is the expected behaviour?
The expected behaviour is that if the header Accept-Language is sent from the client via the hasura action it should be passed on to the request to the nest.js endpoint.
### How to reproduce the issue?
1. Create a nest.js instance that provides a GET endpoint listening and console logging the header Accept-Language
2. Create an action for this endpoint with the "forward client headers to webhook" box ticked in.
3. Send requests to the hasura graphql api with the Accept-Language header attached and watch it console logging 'undefined'
### Screenshots or Screencast

### Please provide any traces or logs that could help here.
### Any possible solutions/workarounds you're aware of?
I tested it a bit and it seems that hasura ONLY blocks the Accept-Language header, if i change the name to something like Cool-Header it arrives as prediced, so one workaround would be to change the entire i18n implementation to look for something else then the commonly accepted 'Accept-Langauge' header, but I would personally like to avoid this.
### Keywords
Headers, Accept-Language, Not Forwarding
Contributor guide
Assessment
This issue has not been assessed yet.