Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] CORs error when publishing to Gitlab Pages #405

Closed
4 tasks done
lashmore opened this issue Dec 5, 2022 · 3 comments
Closed
4 tasks done

[Bug] CORs error when publishing to Gitlab Pages #405

lashmore opened this issue Dec 5, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@lashmore
Copy link

lashmore commented Dec 5, 2022

I confirm:

Hugo version

hugo v0.92.0+extended darwin/amd64 BuildDate=unknown

Where is this bug showing up?

In the browser: Hugo builds the site, but something doesn't look right.

Operating system

macOS

Browser (if applicable)

Chrome 107.0.5304.87

Current behavior

The landing page and the About Me page all load fine, but the posts themselves are “Dangerous” when I access via Chrome.

I saw this Issue, but my baseURL never has "www" as part of it, as Gitlab pages have the URL structure "https:/[GITLAB_USER_NAME].gitlab.io/[NAME_OF_REPO]".

Access to fetch at 'https://gitlab.com/oauth/authorize?client_id=5059a88907e1b093c23df47d996183b101a862a5e53e099b563120d1308db2c1&redirect_uri=https://projects.gitlab.io/auth&response_type=code&state=gF-0-JpkGFuAeKM0nMOIKA==&scope=api' (redirected from 'https://lthistlethwaite-prnt.gitlab.io/icons/link.svg') from origin 'https://lthistlethwaite-prnt.gitlab.io/' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Expected behavior

I expect the posts / articles to load / be viewed when I click the READ MORE button.

Steps to reproduce

Go to https://lthistlethwaite-prnt.gitlab.io/brainy-etc/ and click READ MORE on any of the posts. You'll get a Deceptive site ahead from Chrome.

Relevant log output

Access to fetch at 'https://gitlab.com/oauth/authorize?client_id=5059a88907e1b093c23df47d996183b101a862a5e53e099b563120d1308db2c1&redirect_uri=https://projects.gitlab.io/auth&response_type=code&state=gF-0-JpkGFuAeKM0nMOIKA==&scope=api' (redirected from 'https://lthistlethwaite-prnt.gitlab.io/icons/link.svg') from origin 'https://lthistlethwaite-prnt.gitlab.io/' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Related code

No response

Preferred solution

No response

Other information

No response

@lashmore lashmore added the bug Something isn't working label Dec 5, 2022
@onweru
Copy link
Collaborator

onweru commented Dec 6, 2022

@lashmore https://lthistlethwaite-prnt.gitlab.io/ returns 404, not found

@lashmore
Copy link
Author

lashmore commented Dec 8, 2022

I set my baseURL in the config.toml to: https://lthistlethwaite-prnt.gitlab.io/brainy-etc/, which doesn't have the 404.

Interestingly, Chrome is no longer throwing the DANGEROUS warning/error, but the post itself is all zoomed in / weird looking. Example post (WIP): https://lthistlethwaite-prnt.gitlab.io/brainy-etc/post/viz/

Note, I made no changes to the deployed version of the site, so I'm confused what caused the change in behavior. Was a javascript file HTTP address in the theme updated recently, maybe?

@lashmore
Copy link
Author

lashmore commented Dec 8, 2022

Oops - sorry I see my instructions had the typo!

@lashmore lashmore closed this as completed Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants