404 Not Found during OPTIONS API request to zm/api/monitors/_.json
Describe Your Environment Server
- ZoneMinder 1.34.26
- Ubuntu Installation
- Ubuntu 18.04.5 LTS
Machine + Browser
- Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0
Describe the bug
I'm connecting a web UI with Zone Minder through API calls and I'm trying to use the DELETE Monitor API. Since I'm using fetch() from the browser, I had to enable CORS on my apache server by adding this to a new config file
Header always set Access-Control-Allow-Credentials true
#Allow requests from Thingsboard
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Request-Methods "*"
Header always set Access-Control-Request-Headers "*"
Header always set Access-Control-Allow-Methods: "*"
Header always set Access-Control-Allow-Headers "*"
Header always set Access-Control-Expose-Headers "*"
Header always set Access-Control-Max-Age "1000"
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]
However, the preflight OPTIONS request to http://<myserver>/zm/api/monitors/<number>.json returns "404 Not Found" and I'm not sure why?
To Reproduce Steps to reproduce the behavior:
- Ensure CORS is enabled for your apache server
- Create a button that makes an delete api call onclick
- Look at the browser console log
Thanks for opening your first issue here! Just a reminder, this forum is for Bug Reports only. Be sure to follow the issue template!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.