pallets-eco / pallets-eco/flask-debugtoolbar

Not working for subdmains - blocked by chrome/firefox because of http instead of https

Open
#199 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
978
Forks
151
PR merge metrics
No merged PRs in 30d

Description

When loading from xxx.test toolbar links are using https but when using domain admin.xxx.test debug toolbar is using http for loading assets and both browsers chrome and firefox are now blocking by default under https loading http.

SERVER_NAME: 'xxx.test'
PREFERRED_URL_SCHEME = "https"

register subdomain blueprint
app.register_blueprint(
bp,
url_prefix='/',
subdomain=admin
)

Firefox URL https://admin.xxx.test
Blocked loading mixed active content "http://xxx.test/_debug_toolbar/static/js/jquery.js"
home
Loading failed for the <script> with source “http://xxx.test/_debug_toolbar/static/js/jquery.js”. home:239:1
Blocked loading mixed active content "http://xxx.test/_debug_toolbar/static/js/jquery.tablesorter.js"
home
Loading failed for the <script> with source “http://xxx.test/_debug_toolbar/static/js/jquery.tablesorter.js”. home:240:1
Blocked loading mixed active content "http://xxx.test/_debug_toolbar/static/js/toolbar.js"
home
Loading failed for the <script> with source “http://xxx.test/_debug_toolbar/static/js/toolbar.js”.

Chrome URL https://admin.xxx.test
Mixed Content: The page at 'https://admin.xxx.test/login' was loaded over HTTPS, but requested an insecure script 'http://xxx.test/_debug_toolbar/static/js/jquery.js'. This request has been blocked; the content must be served over HTTPS.
login:1 Mixed Content: The page at 'https://admin.xxx.test/login' was loaded over HTTPS, but requested an insecure script 'http://xxx.test/_debug_toolbar/static/js/jquery.tablesorter.js'. This request has been blocked; the content must be served over HTTPS.
login:1 Mixed Content: The page at 'https://admin.xxx.test/login' was loaded over HTTPS, but requested an insecure script 'http://xxx.test/_debug_toolbar/static/js/toolbar.js'. This request has been blocked; the content must be served over HTTPS.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with SERVER_NAME set to xxx.test, PREFERRED_URL_SCHEME set to https, and the toolbar registered on the admin subdomain. Trace how the debug toolbar builds its asset URLs for a subdomain request and verify the generated scripts use HTTPS, then confirm the assets load without mixed-content errors in Chrome or Firefox.

Written by the indexing model from the issue text.

Assessment

Tech stack
flask, javascript, python
Domain
devtools, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.