Skip to content

Fix CORS blocking and update Google template target resources#359

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/import-new-https-proxy
Draft

Fix CORS blocking and update Google template target resources#359
Copilot wants to merge 2 commits intomasterfrom
copilot/import-new-https-proxy

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 12, 2026

Google login pages fail to fully render (only email field, no password step) because modern Google domains are missing from targetResources and cross-origin headers block resource loading.

Template update (templates/google.com_gsuite.json)

  • Added missing domains: recaptcha.net, www.recaptcha.net, people-pa.googleapis.com, fonts.googleapis.com, fonts.gstatic.com, signaler-pa.clients6.google.com, play.google.com, apis.google.com, lh3.googleusercontent.com, myaccount.google.com, www.googleapis.com

CORS handling (core/proxy.go)

  • Strip Cross-Origin-Resource-Policy, Cross-Origin-Opener-Policy, Cross-Origin-Embedder-Policy headers alongside existing security header stripping
  • Set default Access-Control-Allow-Methods and Access-Control-Allow-Headers on responses when Origin is present, so CORS preflight requests succeed:
if httpResponse.Header.Get("Access-Control-Allow-Methods") == "" {
    httpResponse.Header.Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH")
}
if httpResponse.Header.Get("Access-Control-Allow-Headers") == "" {
    httpResponse.Header.Set("Access-Control-Allow-Headers", "Content-Type, Authorization, X-Requested-With, Accept, Origin")
}

These only apply as defaults — upstream values are preserved when present.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Add missing Google domains to targetResources in google.com_gsuite.json
  (recaptcha.net, fonts.googleapis.com, play.google.com, apis.google.com, etc.)
- Strip Cross-Origin-Resource-Policy, Cross-Origin-Opener-Policy, and
  Cross-Origin-Embedder-Policy headers that block cross-origin resource loading
- Add default Access-Control-Allow-Methods and Access-Control-Allow-Headers
  response headers for CORS preflight request support

Co-authored-by: drk1wi <2052966+drk1wi@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for a new HTTPS proxy Fix CORS blocking and update Google template target resources Feb 12, 2026
Copilot AI requested a review from drk1wi February 12, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants