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.

Assessment

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

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.

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'.

Dominant language
Python
Stars
461
Forks
116
Avg merge
8d 30m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from openwrt/asu

All issues in openwrt/asu

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.