mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[GH-ISSUE #598] OPTIONS method calls are not serviced when the UI is disabled #452
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#452
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @enticedwanderer on GitHub (Feb 2, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/598
I'm running my own instance of ntfy and noticed an issue when trying to configure a bookmarklet in my browser. By default my instance has
web-rootset to disable in the ntfy config, because I don't want the UI exposed publicly. Generally this works well, however...I sometimes want to share a link to a page on my browser to my phone via ntfy. I have set up a bookmarklet (simple JS script that gets embedded on the current page to call ntfy with its location/title).
Because of CORS the browser will issue an OPTIONS call to the above URL first to check valid origins. Currently, ntfy only responds on that method if the
web-rootis not disabled, and otherwise returns a 404 (which causes the browser to refuse to make the actual POST/PUT. I'm curious if that's really necessary. I've confirmed that re-enabling the web-root makes the problem go away. As far as I can tell it would be just a matter of removingensureWebEnabledhere. I'm not sure if there are other implications from doing so. ThehandleOptionsonly sets the CORS headers anyway, so that seems fairly innocuous but I may be missing something.@binwiederhier commented on GitHub (Feb 2, 2023):
Nice catch. This is pretty easy to fix. I'll do it as part of the
user-accountbranch.