Skip to content

Drop sitemap https pin; verify SECURE_PROXY_SSL_HEADER via request.scheme (#1329)#1338

Merged
jonfroehlich merged 1 commit into
masterfrom
1329-verify-sitemap-scheme
Jun 18, 2026
Merged

Drop sitemap https pin; verify SECURE_PROXY_SSL_HEADER via request.scheme (#1329)#1338
jonfroehlich merged 1 commit into
masterfrom
1329-verify-sitemap-scheme

Conversation

@jonfroehlich

Copy link
Copy Markdown
Member

Follow-up to #1336 (which enabled SECURE_PROXY_SSL_HEADER on TEST/PROD). Part of #1329 — does not close it (the site_scheme meta-tag workaround removal is still pending).

Why

After #1336, Django sees the real https scheme behind UW CSE's Apache proxy. But every scheme-dependent output had already been pinned to https as a workaround, so there was nothing left to passively verify against. The sitemap was one such workaround (_HttpsSitemap hardcoded protocol = "https", #1252).

Removing that pin makes /sitemap.xml reflect request.scheme directly — turning it into the one observable that proves SECURE_PROXY_SSL_HEADER is working end-to-end.

Change

Verification (the point of this PR)

After merge → deploy to -test, fetch https://makeabilitylab-test.cs.washington.edu/sitemap.xml:

  • <loc> URLs still https://SECURE_PROXY_SSL_HEADER is honored; safe to proceed with removing the site_scheme meta-tag workaround.
  • <loc> URLs show http:// → the proxy header isn't reaching Django as expected; revert this PR and keep the workarounds.

Tests

Full suite green locally in-container: 279 tests, OK (skipped=1) (--settings=makeabilitylab.settings_test).

🤖 Generated with Claude Code

Now that SECURE_PROXY_SSL_HEADER lets Django see the real https scheme
behind UW CSE's Apache proxy (#1329), the sitemap no longer needs to
pin protocol="https". Remove the _HttpsSitemap base so every sitemap
inherits Django's default behavior, where <loc> URLs use request.scheme.

This doubles as the on-server verification for #1329: /sitemap.xml on
-test now reflects request.scheme directly, so if its <loc> URLs stay
https the proxy header is being honored end-to-end (the meta-tag
site_scheme workaround masks this everywhere else).

Tests: replace the old "always https" assertion with one that drives
the scheme via an X-Forwarded-Proto header under SECURE_PROXY_SSL_HEADER
(the real #1329 path), plus a check that a plain request now reflects
the request scheme rather than a hardcoded https.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jonfroehlich jonfroehlich merged commit 399cedc into master Jun 18, 2026
2 checks passed
jonfroehlich added a commit that referenced this pull request Jun 18, 2026
…workaround, Pa11y CI)

Removes the site_scheme context-processor workaround now that
SECURE_PROXY_SSL_HEADER is trusted on TEST/PROD; https is derived from
request.scheme behind UW CSE's TLS proxy (#1329/#1236, #1338). Wires the
Pa11y accessibility sweep into CI and excludes django-debug-toolbar from
the scan (#1278 item 6). No schema change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant