Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hey so I have this error message when I try to access previews front my Nuxt app x-faustwp-secret headers is not authorized .

When I bypass using an extension (such as this one for instance https://addons.mozilla.org/fr/firefox/addon/cors-everywhere/ ) everything works perfectly

So I think for some reason my cors are getting ignored, in my wordpress theme I added :

function add_cors_http_header(){
    header("Access-Control-Allow-Headers: * , x-faustwp-secret"); // also tried without the *
    header("Access-Control-Allow-Origin: *");
}
add_action( 'send_headers', 'add_cors_http_header' );

I even tried to add the headers directly in .htaccess file using :

<IfModule mod_headers.c>
	Header set Access-Control-Allow-Headers "* , x-faustwp-secret"
 </IfModule>

Does anyone know where it might come from or encountered this issue ? I contacted the support from my web server but they couldn't help.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.