jobsuche-api icon indicating copy to clipboard operation
jobsuche-api copied to clipboard

Access-Control-Allow-Headers issue

Open DoT89 opened this issue 3 years ago • 5 comments

Selbst beim Ausführen der Beispiel-Query erhalte ich folgenden Fehler: TypeError: Request header field X-Requested-With is not allowed by Access-Control-Allow-Headers.

Läuft in einer Dockerinstanz bei mir.

DoT89 avatar Aug 05 '21 15:08 DoT89

Kannst Du mal bitte die curls sharen, mit allen headers die du so setzt?

LilithWittmann avatar Aug 07 '21 22:08 LilithWittmann

Ich bin begeistert. Eine Rest API von der oder für die BA. Wollte auch gleich ausprobieren und bekomme beim Versuch mir ein token per XHR Request (axios) eine CORS Fehlermeldung.

Ich habe hier ein Beispiel:

https://cbleek.gitlab.io/ba-quasar-ui/#/

Auswahl_999(1262)

Quellcode: https://gitlab.com/cbleek/ba-quasar-ui

cbleek avatar Sep 30 '22 14:09 cbleek

Ich bin begeistert. Eine Rest API von der oder für die BA. Wollte auch gleich ausprobieren und bekomme beim Versuch mir ein token per XHR Request (axios) eine CORS Fehlermeldung.

Ich habe hier ein Beispiel:

https://cbleek.gitlab.io/ba-quasar-ui/#/

Auswahl_999(1262)

Quellcode: https://gitlab.com/cbleek/ba-quasar-ui

Zur Zeit scheinen Wrapper-Services für die durchzuführenden API-Aufrufe eine geeignete Möglichkeit zu sein, die CORS-Thematik auf dem Client zu umgehen.

v-black avatar Jan 13 '23 13:01 v-black

@cbleek The best thing is to use a backend to make all requests needed and return only results to the front end, I have done that, check result here for example: un authed api on my site

maenkhouseh avatar Jan 13 '23 13:01 maenkhouseh

I'd suggest you open up your code a bit more as currently it only throws "deprecation" errors

Personally I use

<?php
    define("ALLOW_SOURCE",TRUE);
    define("ALLOW_TITLE",TRUE);
    if(ALLOW_SOURCE && isset($_GET['source'])){
        highlight_file(__FILE__);
        exit(0);
    }
?>
<a target="_blank" href="?source">Source Code</a>

For allowing source viewing. (That way others can chime in) I'd personally be glad for a php example. Sofar all attempts to interface with bA did not net results for me.

Ry3yr avatar Dec 21 '23 06:12 Ry3yr