• Resolved Bobs Bee

    (@markmccarricksig)


    Hello Webfactory and Alexandru,

    I’m trying to implement some header changes on my wordpress.com based site. I’ve noticed that no matter what I try, even if the box is blank, when I click ‘Test Before Saving’ the syntax editor tells me there’s an error.

    Here’s the code I actually want to enter:

    #Security Headers
    <IfModule mod_headers.c>
    Header always set X-Frame-Options "SAMEORIGIN"
    Header always set X-Permitted-Cross-Domain-Policies "none"
    Header always set Cross-Origin-Embedder-Policy "unsafe-none"
    Header always set Cross-Origin-Opener-Policy "same-origin"
    Header always set Cross-Origin-Resource-Policy "same-origin"
    Header always set Referrer-Policy "strict-origin-when-cross-origin"
    Header always set X-Content-Type-Options "nosniff"
    Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"

    Header always set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline';"


    </IfModule>
    #End Security Headers

    Any idea why the editor is test failing? Would it be safe to continue with the above code regardless?

    Thanks,

    BB

Viewing 1 replies (of 1 total)
  • Plugin Author Alexandru Tapuleasa

    (@talextech)

    Hi,

    It’s hard to say… sometimes it can be a “false positive” where the update is OK but just the test is failing, but it’s risky. The test basically involves making the .htacces update and then making a request to homepage to see if it still works as expected. I guess in some cases there can be a firewall or some other issue that breaks the test. But like I said, don’t do it unless you have access to restore the .htaccess file FTP or your hosting panel.

Viewing 1 replies (of 1 total)

The topic ‘Test Before Saving – Always returns error’ is closed to new replies.