zoneminder icon indicating copy to clipboard operation
zoneminder copied to clipboard

404 Not Found during OPTIONS API request to zm/api/monitors/_.json

Open justanhy opened this issue 4 years ago • 2 comments

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:

  1. Ensure CORS is enabled for your apache server
  2. Create a button that makes an delete api call onclick
  3. Look at the browser console log

justanhy avatar Aug 20 '21 08:08 justanhy

Thanks for opening your first issue here! Just a reminder, this forum is for Bug Reports only. Be sure to follow the issue template!

welcome[bot] avatar Aug 20 '21 08:08 welcome[bot]

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.

stale[bot] avatar Apr 16 '22 06:04 stale[bot]