-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
DELETE endpoints do not include ‘Access-Control-Allow-Origin’ in the header which causes web browsers to report a CORS error #2261
Comments
i know that additional headers can be included but i don't understand what causes the DELETE to fail when not hosted on Pi-hole device and all the other requests are successful |
these are included in the response of every other endpoint that's not a DELETE endpoint from what i can see. |
Is it? From another machine:
On the Pi-hole itself:
I don't see |
I am undecided concerning the |
I would be cautious with headers like |
this is what i get from the API curl command that i tried. was copied directly from
same request via javascript in firefox
If they aren't set currently, where are they coming from? my
|
a screen recording of Pi-hole Web UI in Firefox with every api endpoint response header contains the same
Screencast.From.2025-03-08.22-43-08.webm |
this can also be seen when using https://pi.hole/api/docs/#get-/auth click the try button and then view what is shown for response headers, you will see the following IF logged in
maybe this is something that is an API specific issue since it seems the inclusion of
|
Versions
Core
Version is v6.0.4-1-ga7e414ac (Latest: null)
Branch is development
Hash is a7e414a (Latest: a7e414a)
Web
Version is v6.0.1-10-gec8beaf5 (Latest: null)
Branch is development
Hash is ec8beaf5 (Latest: ec8beaf5)
FTL
Version is vDev-39a852e (Latest: null)
Branch is development
Hash is 39a852e (Latest: 39a852e)
Platform
Expected behavior
Access-Control-Allow-Origin: * to be in the header like it is with other endpoints
Actual behavior / bug
Access-Control-Allow-Origin: * is missing and seems to cause Firefox and Chrome to report a CORS error
Steps to reproduce
Steps to reproduce the behavior:
https://gist.github.com/mwoolweaver/f5fe7a58f38cfe68e05b7b5e491e65fc
simple website to allow quickly disabling pihole via bookmark
download the file locally (not on Pi-hole)
Open in firefox or chrome and fill in the boxes with relevant info and open the inspector before clicking submit
click submit and watch the DELETE request show a CORS error
now host that same file on the Pi-hole device, repeat steps 2 & 3
now you will see the 204 response that's expected without the CORS error
Debug Token
Screenshots
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: