You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Avoid using .Permalink for integrity-guaranteed resources, which may cause the CORS issue.
For example, suppose the baseURL is https://www.ABC.com , when the user type https://ABC.com for a visit, they are most likely to encounter a CORS error:
Subresource Integrity: The resource 'https://www.abc.com/scss/journal.min.9ea79fa….css' has an integrity attribute, but the resource requires the request to be CORS enabled to check the integrity, and it is not. The resource has been blocked because the integrity cannot be enforced.
Because the current host is ABC.com, which is not equal to www.ABC.com.
Also, if the user is running Hugo on a remote server, the preview mode will not be available. Because the host of the resource will be set as localhost, other than the domain name of the remote host.
Solution
Change .Permalink to .RelPermalink
The text was updated successfully, but these errors were encountered:
Hi my-yy
I decided to change all Permalink into RelPermalink. But I suggest you make a redirection from ABC.com to www.ABC.com or somewhat. The best practice is to make these two sites into one, in order to avoid some problems.
Thanks for your feedback.
Describe the bug
head.html
rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}" media="screen".... rel="stylesheet" href="{{ $darkmode.Permalink }}" integrity="{{ $darkmode.Data.Integrity }}" media="screen"...
Avoid using
.Permalink
for integrity-guaranteed resources, which may cause the CORS issue.For example, suppose the
baseURL
ishttps://www.ABC.com
, when the user typehttps://ABC.com
for a visit, they are most likely to encounter a CORS error:Because the current host is
ABC.com
, which is not equal towww.ABC.com
.Also, if the user is running Hugo on a remote server, the preview mode will not be available. Because the host of the resource will be set as
localhost
, other than the domain name of the remote host.Solution
Change
.Permalink
to.RelPermalink
The text was updated successfully, but these errors were encountered: