Inbound request header not present

I’ve got an odd question. Are qovery inbound requests treated differently?
For some reason, the same exact app with the same exact Dockerfile works correctly on Heroku but on Qovery a header that’s added at runtime (from the frontend) is passed to the request but for some reason, the backend does not have that header :thinking: while is does (as expected) on the Heroku counterpart

specify here your dockerfile content

# Use the official lightweight Node.js 14 image.
# https://hub.docker.com/_/node
FROM node:14-alpine

# Create and change to the app directory.
WORKDIR /usr/src/app

# Declare env variables.
ENV PORT 80
ENV HOST 0.0.0.0

# Copy application dependency manifests to the container image.
# A wildcard is used to ensure both package.json AND package-lock.json are copied.
# Copying this separately prevents re-running npm install on every code change.
COPY package*.json ./

# Install dependencies
RUN yarn

# Copy local code to the container image.
COPY . ./

# Expose the port
EXPOSE 80

# Build the application
RUN yarn build

# Run the web service on container startup.
CMD [ "yarn", "start:prod" ]
1 Like

Hello @JoaquimLey,

At the moment, the Qovery load balancer is filtering non-standard HTTP header.
Can you let me know which HTTP header you are trying to add in your request so I can take a look ?

Hello there, first of all, thank you for taking the time to look into this Q.

As for the header, it is company_id, but custom headers are very common so this would be a recurring issue maybe? Can we get a small warning at the build time or in the docs?

Thanks,

Yeah, it is what I thought. I haven’t looked in details what we filter or not, but non-standard HTTP header must start by X-xxx to advertise that this is a custom header.

As is, there is no way that our Load Balancer is going to forward header company_id as it does not follow this convention.

We plan later to add settings for allowing this kind of behavior, but for now it is not planned in a short term.

Going to check if we forward header starting by X-xxx

Any news on this? I want to know if this is supposed to be the prefix to the header.

hi back,

Just tried it out, and the load balancer forward custom header but not the one that contains an _

As you can see in the screenshot below, just replace the _ by a - and it should be forwarded to your application

https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#missing-disappearing-http-headers

Maybe this is something we can enable on our side, need to discuss about it. But in the meantime, just do not use _ in your http headers :x

1 Like

It does solve my issue does not look like a solution thought. Changing the code due to the host and even more with Docker seems like it shouldn’t be the case.

Hi Joaquim, I will see that issue with the team and get back to you as soon as possible.

1 Like