openwrt / openwrt/asu

ASU server: access to xmlhttprequest has been blocked by cors policy

Open
#1,388 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
450
Forks
111
PR merge metrics
No merged PRs in 30d

Description

I installed my own ASU server based on the guide here, but creating a new image doesn't work. I become the following error in the browser when I request an image:

Access to XMLHttpRequest at 'http://<server_IP>/api/v1/overview?1745428639689' from origin 'http://<router_IP>' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

GET http://<server_IP>/api/v1/overview?1745428639689 net::ERR_FAILED 301 (Moved Permanently)
(anonymous) | @ | luci.js?v=25.111.775…4aa1d-1745362806:59
(anonymous) | @ | luci.js?v=25.111.775…4aa1d-1745362806:40
Promise.then
request | @ | luci.js?v=25.111.775…4aa1d-1745362806:40
get | @ | luci.js?v=25.111.775…4aa1d-1745362806:64
handleCheck | @ | overview.js?v=25.111…4aa1d-1745362806:21
eval | @ | ui.js?v=25.111.77565…aa1d-1745362806:368

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'ok')
at eval (overview.js?v=25.111.77565~1b4aa1d-1745362806:21:1728)
eval | @ | overview.js?v=25.111…4aa1d-1745362806:21
Promise.then |  
handleCheck | @ | overview.js?v=25.111…4aa1d-1745362806:21
eval | @ | ui.js?v=25.111.77565…aa1d-1745362806:368

When I paste the 'http://<server_IP>/api/v1/overview?1745428639689' in the browser, then I become the result on the following url: 'http://<server_IP>/json/v1/overview.json'.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ASU server installation guide and trace the /api/v1/overview request that redirects to /json/v1/overview.json. Check how the server handles requests from the router origin and compare the browser request with the server response. Done means creating a new image works without the CORS or undefined-response errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
flask, python
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.