-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
ha-proxy.js sends two location headers #2227
Comments
…dd multiple location headers by using setHeader instead (#2228, #2227, @mpietruschka) Co-authored-by: Jens Maus <mail@jens-maus.de>
@jens-maus So you don't want to set the location header, when it didn't exist in the response header, right?
|
Of course I always want to set the location header. AFAIK the |
@jens-maus Please excuse my odd way of asking my question. Of course I assumed that you want it always to be set. Somehow I had been confused by the referenced bugreport. I'll test it later! Thanks again :) |
@jens-maus Your solution works great! |
Describe the issue you are experiencing
I do integrate raspberrymatic supervised, with traefik and docker labels. Raspberymatic is supposed to be accessable by the location http://hostname-doesnt-matter/raspberrymatic/.
To make that happen I reused your HomeAssistant integration, added the neccessary 'x-ingress-path' headern and HM_HAPROXY_SRC environment variable. Everything looked very promissing until I accessed the starting page http://hostname-doesnt-matte/raspberrymatic/
My browser stopped porcessing the response by "Beim Laden der Seite http://10.0.0.2/raspberrymatic/pages/index.htm wurde gegen das Netzwerkprotokoll verstoßen. Dieser Fehler kann nicht behoben werden."
After some digging I found out that your ha-proxy.js adds a second location header to the response. Since Traefik does not sanitize headers, my browser was the first one complaining.
A simple res.removeHeader('location'); before res.append("location", redirect); in your ha-proxy.js is doing the trick.
I'm going to send a Pull Request.
Describe the behavior you expected
Here's my test-setup...
Steps to reproduce the issue
Setup traefik
What is the version this bug report is based on?
3.67.10.20230114
Which base platform are you running?
rpi4 (RaspberryPi4)
Which HomeMatic/homematicIP radio module are you using?
RPI-RF-MOD
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: