When the exact same URL is being used in both by CORS and its web pages' URL, I still get the same error messages in my Firefox development console.
Browser console messages were:
Cross-Origin Request Blocked: \
The Same Origin Policy disallows reading the remote resource \
at https://egbert.net/fonts/fontawesome-webfont.woff2?v=4.7.0. \
(Reason: CORS header ‘Access-Control-Allow-Origin’ does not \
match ‘https://egbert.net’).
Header Settings, lighttpd Server
Access-Control-Allow-Origin: https://egbert.net
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range
Content-Security-Policy: \
default-src 'none'; \
base-uri 'none'; \
script-src 'strict-dynamic'; \
object-src 'none'; \
style-src 'self'; \
img-src https://egbert.net/favicon.ico https://egbert.net/images/ https://egbert.net/blog/articles/*/images/*.png data:; \
media-src https://egbert.net/media/ data:; \
frame-src https://egbert.net/frames/; \
frame-ancestors 'self'; \
worker-src 'self'; \
child-src https://egbert.net/frames/; \
font-src https://egbert.net/fonts/; \
connect-src 'self' https://egbert.net/; \
form-action 'none'; \
require-trusted-types-for; \
trusted-types template; \
sandbox; \
report-uri https://ssoseo1.report-uri.com/r/d/csp/enforce; \
report-to endpoint-1; \
upgrade-insecure-requests; \
block-all-mixed-content;
Feature-Policy: accelerometer 'none'; camera 'none'; fullscreen 'self'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; midi 'none'; notifications 'none'; payment 'none'; push 'none'; sync-xhr 'none'; speaker 'none'; usb 'none'; vibrate 'none';
Referrer-Policy: no-referrer
HTML settings
<link rel="stylesheet" href="https://egbert.net/css/m-dark.compiled.css">
CSS path
*/@font-face {
font-family:'FontAwesome';
src:url('../fonts/fontawesome-webfont.eot?v=4.7.0');
src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'),
url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),
url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'),
url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'),
url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
font-weight:normal;
font-style:normal
}
I've ensured that all font files are able to be downloaded by the same browser in separate tabs.
And what's weirder is that the error message implies "remote resource". They're the exact same URL.
No plugins were loaded, this is safe mode Firefox v73.0.1.
Update 1
It didn't change anything when I replaced the relative path ('../fonts') in the /@font-face
of CSS with an absolute directory path.
Update 2
It didn't change anything when I added the scheme and domain (https://egbert.net/) to the /@font-face
of CSS in front of the absolute directory path for a full-blown URL path.
This is not the same issue as:
- Why doesn’t Postman get a “No 'Access-Control-Allow-Origin' header is present on
- Font from origin has been blocked from loading by Cross-Origin Resource Sharing policy
- Firefox 'Cross-Origin Request Blocked' despite headers
- How to get a cross-origin resource sharing (CORS) post request working
- Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at
- Same origin Policy and CORS (Cross-origin resource sharing)
- Socket.IO: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource
- google maps - Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at
- Cross-Origin Request Blocked Microsoft Azure Function