Skip to content
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

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

Open
Justanhy opened this issue Aug 20, 2021 · 2 comments
Open

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

Justanhy opened this issue Aug 20, 2021 · 2 comments
Labels

Comments

@Justanhy
Copy link

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
@welcome
Copy link

welcome bot commented Aug 20, 2021

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

@stale
Copy link

stale bot commented Apr 16, 2022

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 stale bot added the stale label Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 participant