Closed williamle92 closed 1 year ago
Hello @williamle92,
Thanks for your interest in this Traefik plugin !
What do you mean by pseudo headers ?
Hello @tomMoulard ,
Pseudo-headers are sent in each request that give more details about the request. I believe Traefik
sets these pseudo-headers on the request which become available on our flask request headers.
Here are some examples of pseudo-headers taken from portswigger
:method - The HTTP method of the request, such as GET or POST.
:path - The request path. Note that this includes the query string.
:authority - Roughly equivalent to the Host header in HTTP/1.
:scheme - The request scheme, typically http or https. Note that there is no equivalent in HTTP/1.
:status - The response status code.
Also an example you would see in google console.
Here are all headers added by traefik, doc:
X-Forwarded-For: 10.42.0.1
X-Forwarded-Host: localhost
X-Forwarded-Port: 80
X-Forwarded-Proto: http
X-Forwarded-Server: traefik-5496cff6c7-4xwbh
It is not common for reverse proxy to add more headers that contain the request's data.
Nevertheless, if you are just trying to extract data from the cookies, you can find the cookies values as headers:
> curl localhost/whoami -H "Cookie: foo=bar"
...
GET /whoami HTTP/1.1
Host: localhost
User-Agent: curl/7.79.0-DEV
...
Cookie: foo=bar
Thank you Tom for your response. So it seems like there are no ways for me to access these pseudo headers through traefik and it seems like it is not even supposed to be added as a regular header(I read some pep docs). I will close this thread.
Hello,
Is it possible to join pseudo headers (such as
:path
) into a newly created header?My use-case: I am trying to implement a rate limit per path using the
RateLimit
middleware with source criterion pointed to a new header. This new header will extract user id from cookie (which I was able to do), but I need to add the value of:path
header to this new header to make it possible.Thank you for your time.