-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[BUG] Widgets are not sending X-Api-Key and Authorization headers #1549
Comments
Confirmed with my Proxmox list widget. The reason is a change or a bug in the internal API. Most probably related to this commit It looks like that the widget mixin used to collect all headers passed to the I confirmed the bug by manually passing the CustomHeaders header like this
I can send a PR for my widgets, but before that I think @Lissy93 should have a look at the code, and decide whether the widgets should be responsible for this CustomHeaders, or the mixin will be fixed to take care of it. |
Thanks @alayham - this should be fixed in 3.0.1 |
I'm still seeing the issue in 3.0.1. |
@Lissy93 I have Confirmed that the issue still exists in the latest commit, and that my patch above resolves it for my Proxmox widgets. |
Should be fixed in #1576 :) |
Confirmed, the fix resolved the issue for me. |
Thank you! |
Environment
Self-Hosted (Docker)
System
Firefox 125.0.2
Version
3.0.0
Describe the problem
Summary: Widgets are not sending the X-Api-Key and Authorization headers.
This is based on troubleshooting the issue I posted in the 3.0.0 discussion #1537 (comment)
Description: After upgrading to version 3.0.0 I noticed that my HealthChecks and Uptime-Kuma widgets were no longer working and failed with "Proxy returned error from target server". Looking in the console log (attached below), the proxy server was getting a 401 error from HealthChecks. Both HealthChecks and uptime-kuma servers are running on my local network and were working in Dashy version 2.1.2. After troubleshooting I've come to the conclusion that Widgets are not sending appropriate key/auth headers to the server endpoints. Both non-working widgets are supposed to send a header with
this.makeRequest(this.endpoint, authHeaders)
. However, those headers are not being sent. The Weather widget works fine, which makes sense because for that widget, the apiKey is appended to the url instead. It appears the headers are being sent to the Dashy cors proxy, but they are not being forwarded to the server. Details below.Troubleshooting: I set up a new instance of Dashy using the default config to make sure nothing in my config was wrong (see example below), but it still had the proxy error. Using
curl
to query the endpoint from the host returns the proper response. Additionally, querying the endpoint within the Dashy container returned a correct response usingdocker exec -it dashy curl -H "X-Api-Key: yMu9uTiVQDCWas3hnRwlWTm22kAc4APY" http://192.168.0.150:3002
. Finally, attempting the request in Firefox with the "Allow CORS" addon activated still failed.Indeed, HealthChecks was rejecting the request with a 401 error:
These pieces of evidence led me to believe it was an issue with Dashy.
I intercepted the request and found that the X-Api-Key header was not being sent to the HealthChecks endpoint. These are the intercepted headers sent to HealthChecks, note the absence of the X-Api-Key header that should contain the apiKey passed in the config:
Interestingly, the x-api-key header was being sent to the Dashy cors proxy when looking in the console log, but was not being forwarded on:
Additional info
Deprecation warning: The
simple-icons
entrypoint will be removed in the next major. Please switch to usingimport * as icons from "simple-icons/icons"
if you need an object with all the icons. index.js:1:8Dashy V3.0.0 🚀 CoolConsole.js:6:10
XHRGET
http://192.168.0.150:4000/cors-proxy
[HTTP/1.1 500 Internal Server Error 16ms]
Proxy returned error from target server
This is likely not an issue with Dashy, but rather your configuration.
If you think it is a bug, please open a ticket on GitHub: https://git.io/JukXk CoolConsole.js:11:10
Stack Trace
Request failed with status code 401 CoolConsole.js:18:12
Please tick the boxes
The text was updated successfully, but these errors were encountered: