You are not logged in.

#1 2020-01-05 07:17:45

wis
Member
Registered: 2019-02-15
Posts: 14

[SOLVED] aur CORS issue: why not allow requests to offical repos API?

I made a userscript that makes HTTP requests to the Official repositories web interface and works fine on pages on the www sub-domain but not on pages on the aur sub-domain, because of CORS.

since they're both hosted by you, is there any security reason you can't configure CORS to allow that?

Last edited by wis (2020-01-06 05:33:31)

Offline

#2 2020-01-05 12:35:16

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [SOLVED] aur CORS issue: why not allow requests to offical repos API?

You are aware that archweb and aurweb are two independent projects[1] with their own interfaces ?

If you need info from AUR, see https://wiki.archlinux.org/index.php/Au … _interface



[1]
https://git.archlinux.org/archweb.git/
https://git.archlinux.org/aurweb.git/

Last edited by Lone_Wolf (2020-01-05 12:37:20)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2020-01-05 13:42:51

wis
Member
Registered: 2019-02-15
Posts: 14

Re: [SOLVED] aur CORS issue: why not allow requests to offical repos API?

Thanks for the reply and links, but yes I am, already read it and tried the AUR API (because it'd solve this issue because it's on same origin, aur.archlinux.org) but it has no feature for getting info of a package in official repo.
I'm trying to get info of each of the aur package's dependencies, which are in official repos.

Offline

#4 2020-01-05 14:34:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED] aur CORS issue: why not allow requests to offical repos API?

I'm not sure I follow.  There's a base url and API for main repo packages, and another for AUR packages.  If you want information on a main repo package, use the former; if you want information on an AUR package, use the latter.  What's the actual problem?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2020-01-05 15:00:56

wis
Member
Registered: 2019-02-15
Posts: 14

Re: [SOLVED] aur CORS issue: why not allow requests to offical repos API?

Trilby wrote:

I'm not sure I follow.  There's a base url and API for main repo packages, and another for AUR packages.  If you want information on a main repo package, use the former; if you want information on an AUR package, use the latter.  What's the actual problem?

It's CORS, if it's not configured on the Official repositories web interface server to allow the browser to make ajax requests from aur web pages (at aur.archlinux.org) to itself (the server of the Official repositories web interface, at www.archlinux.org), the browser prevents you from making an ajax request to the Official repositories web interface from an aur web page, because the web page is on different origin (aur.archlinux.org) and not on the same-origin as the API (www.archlinux.org).

Offline

#6 2020-01-05 15:22:16

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: [SOLVED] aur CORS issue: why not allow requests to offical repos API?

You are aware of this function, right?
https://wiki.greasespot.net/GM.xmlHttpRequest


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#7 2020-01-06 05:32:56

wis
Member
Registered: 2019-02-15
Posts: 14

Re: [SOLVED] aur CORS issue: why not allow requests to offical repos API?

progandy wrote:

You are aware of this function, right?
https://wiki.greasespot.net/GM.xmlHttpRequest

well.. now I am, you solved it, thanks a lot! smile

Last edited by wis (2020-01-06 05:34:45)

Offline

Board footer

Powered by FluxBB