Closed
Description
Environment
Self-Hosted (Docker)
Version
2.0.7
Describe the problem
Hello,
I think I've found a bug in using the openweathermap API (api.openweathermap.org) or the API's behavior has changed.
Problem:
I created a widget with weather-forecast and got 401 HTTP-code, where app try to send request.
Widget configuration in conf.yml looks like:
sections:
- name: Today
icon: far fa-calendar-day
widgets:
- type: weather-forecast
options:
apiKey: <API_KEY>
numDays: 6
city: London
units: metric
On Network tabs i see request like:
Then i try repeat request with curl and it's really response 401:
curl -v "https://api.openweathermap.org/data/2.5/forecast/daily?q=London&cnt=3&units=metric&appid=<API_KEY>" -o /dev/null
> GET /data/2.5/forecast/daily?q=London&cnt=3&units=metric&appid=<API_KEY>
HTTP/1.1
> Host: api.openweathermap.org
> User-Agent: curl/7.68.0
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Server: openresty
< Date: Fri, 29 Apr 2022 11:07:14 GMT
< Content-Type: application/json; charset=utf-8
< Content-Length: 107
< Connection: keep-alive
< X-Cache-Key: /data/2.5/forecast/daily?cnt=3&q=london,us&units=metric
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Methods: GET, POST
But if try send request without daily, it's works fine:
curl -v "https://api.openweathermap.org/data/2.5/forecast/?q=London&cnt=3&units=metric&appid=<API_KEY>" -o /dev/null
> GET /data/2.5/forecast/?q=London&cnt=3&units=metric&appid=<API_KEY>
HTTP/1.1
> Host: api.openweathermap.org
> User-Agent: curl/7.68.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: openresty
< Date: Fri, 29 Apr 2022 11:08:36 GMT
< Content-Type: application/json; charset=utf-8
< Content-Length: 1389
< Connection: keep-alive
< X-Cache-Key: /data/2.5/forecast/?cnt=3&q=london&units=metric
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Methods: GET, POST
Maybe I missed something, but it looks like an invalid API request. Hope for your update)
Additional info
No response
Please tick the boxes
- You are using a supported version of Dashy (check the first two digits of the version number)
- You've checked that this issue hasn't already been raised
- You've checked the docs and troubleshooting guide
- You agree to the code of conduct