cors problem #26

Closed
opened 2021-10-14 14:38:11 +00:00 by lunny · 6 comments
Owner

chrome dev console error

Uncaught DOMException: Failed to construct 'SharedWorker': Script at 'https://s.gitea.com/assets/js/eventsource.sharedworker.js' cannot be accessed from origin 'https://gitea.com'.
    at https://s.gitea.com/assets/js/index.js?v=382040f71d3607a782af829190275f9c:35:19124
    at Generator.next (<anonymous>)
    at https://s.gitea.com/assets/js/index.js?v=382040f71d3607a782af829190275f9c:35:18260
    at new Promise (<anonymous>)
    at sa (https://s.gitea.com/assets/js/index.js?v=382040f71d3607a782af829190275f9c:35:18076)
    at zm (https://s.gitea.com/assets/js/index.js?v=382040f71d3607a782af829190275f9c:35:18964)
    at https://s.gitea.com/assets/js/index.js?v=382040f71d3607a782af829190275f9c:68:20151
    at Generator.next (<anonymous>)
    at f (https://s.gitea.com/assets/js/index.js?v=382040f71d3607a782af829190275f9c:35:27135)
chrome dev console error ``` Uncaught DOMException: Failed to construct 'SharedWorker': Script at 'https://s.gitea.com/assets/js/eventsource.sharedworker.js' cannot be accessed from origin 'https://gitea.com'. at https://s.gitea.com/assets/js/index.js?v=382040f71d3607a782af829190275f9c:35:19124 at Generator.next (<anonymous>) at https://s.gitea.com/assets/js/index.js?v=382040f71d3607a782af829190275f9c:35:18260 at new Promise (<anonymous>) at sa (https://s.gitea.com/assets/js/index.js?v=382040f71d3607a782af829190275f9c:35:18076) at zm (https://s.gitea.com/assets/js/index.js?v=382040f71d3607a782af829190275f9c:35:18964) at https://s.gitea.com/assets/js/index.js?v=382040f71d3607a782af829190275f9c:68:20151 at Generator.next (<anonymous>) at f (https://s.gitea.com/assets/js/index.js?v=382040f71d3607a782af829190275f9c:35:27135) ```
Member

Weird one, index.js is already loaded from s.gitea.com, so the same-origin policy should apply.

Generally, I think we'd be better to just get rid of s.gitea.com and serve everything from gitea.com, possibly offloading the /assets/ path to a static file server to take load off the Go application. With HTTP2, there is no limit on concurrent HTTP requests, so performance will be better.

Weird one, `index.js` is already loaded from `s.gitea.com`, so the same-origin policy should apply. Generally, I think we'd be better to just get rid of `s.gitea.com` and serve everything from `gitea.com`, possibly offloading the `/assets/` path to a static file server to take load off the Go application. With HTTP2, there is no limit on concurrent HTTP requests, so performance will be better.
Author
Owner

@silverwind Using s.gitea.com is to accelerate static assets visit via the CDN from bunny.net .

@silverwind Using s.gitea.com is to accelerate static assets visit via the CDN from bunny.net .
chain added a new dependency 2021-10-16 05:12:44 +00:00
chain removed a dependency 2021-10-16 05:13:07 +00:00
Member

I'm sure there is a underlying bug somewhere here, but I just fail to see it yet. I don't think it can be solved with CORS as those web worker origin restrictions work differently I think.

I'm sure there is a underlying bug somewhere here, but I just fail to see it yet. I don't think it can be solved with CORS as those web worker origin restrictions work differently I think.
Member

https://stackoverflow.com/a/62914052 might be a workaround to try.

https://stackoverflow.com/a/62914052 might be a workaround to try.
Author
Owner

https://stackoverflow.com/a/62914052 might be a workaround to try.

I will try that later.

> https://stackoverflow.com/a/62914052 might be a workaround to try. I will try that later.
lunny self-assigned this 2021-10-16 16:04:33 +00:00
Author
Owner

Since I have moved s.gitea.com back to gitea.com, this could be closed.

Since I have moved s.gitea.com back to gitea.com, this could be closed.
lunny closed this issue 2022-01-21 16:27:04 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/gitea.com#26
No description provided.