Skip to content

Preflight to /upload is blocked by Chrome v104+ #724

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

Closed
3 tasks done
mabraidot opened this issue Sep 14, 2022 · 4 comments · Fixed by #873
Closed
3 tasks done

Preflight to /upload is blocked by Chrome v104+ #724

mabraidot opened this issue Sep 14, 2022 · 4 comments · Fixed by #873
Assignees
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@mabraidot
Copy link

Describe the problem

Starting with Chrome v104, requests to private networks will be blocked if they don't respond with the header:
Access-Control-Allow-Private-Network: true
Please, read about at developer.chrome.com

To reproduce

Update Chrome to the latest.
Make a POST request to http://localhost:{AGENT_PORT}/upload

Expected behavior

Response code: 200
Header: Access-Control-Allow-Private-Network: true

Arduino Create Agent version

1.2.6

Operating system

Windows

Operating system version

11

Browser

Chrome

Browser version

105.0.5195.125

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details
@mabraidot mabraidot added the type: imperfection Perceived defect in any part of project label Sep 14, 2022
@per1234 per1234 added the topic: code Related to content of the project itself label Sep 15, 2022
@umbynos umbynos self-assigned this Sep 15, 2022
@umbynos
Copy link
Contributor

umbynos commented Sep 19, 2022

Thanks a lot for this heads up!

Apparently from the rollout plan

In Chrome 107 at the earliest:
...

  • Chrome enforces that preflight requests must succeed, otherwise failing the requests.

This means that as of now this should be still working, but starting from Chrome 107 it will break.

After some investigation, I've found that the library we use for the CORS does not support this. We could switch to the more popular and maintained gin-contrib/cors but it doesn't support preflight request yet.

@umbynos
Copy link
Contributor

umbynos commented Jun 23, 2023

The timeline of chrome changed: https://developer.chrome.com/blog/private-network-access-update/#chrome-117
Chrome 117 is scheduled for september 2023

@jub0bs
Copy link

jub0bs commented Dec 10, 2023

@umbynos FWIW, jub0bs/fcors supports Private Network Access and can be used in conjunction with Gin.

@jub0bs
Copy link

jub0bs commented Dec 11, 2023

Incidentally, gin-contrib/cors also appears to support Private Network Access, now.

@alessio-perugini alessio-perugini linked a pull request Dec 18, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants