Use request host for exhibit URLs instead of hardcoded jandig.app (#822)#941
Open
vjpixel wants to merge 1 commit into
Open
Use request host for exhibit URLs instead of hardcoded jandig.app (#822)#941vjpixel wants to merge 1 commit into
vjpixel wants to merge 1 commit into
Conversation
Exhibit detail and create-exhibit pages were rendering links and URL previews with a hardcoded https://jandig.app/. On dev, an exhibit at dev.jandig.app/exhibit/?id=N showed a "share" link pointing at https://jandig.app/<slug>/, sending users away from the dev environment they were testing on. Switch the user-facing references to {{ request.scheme }}://{{ request.get_host() }}/ so dev.jandig.app and jandig.app each link to themselves. The "See this exhibition" anchor in exhibit_detail uses a relative /{slug} path, which avoids the question entirely. Files: - exhibit_detail.jinja2: dynamic display URL + relative href. - exhibit_create_ar.jinja2 / exhibit_create_mr.jinja2: dynamic url-helper preview label. Closes #822 https://claude.ai/code/session_01XC1THLWgnGXGf5wgRhdyvB
pablodiegoss
requested changes
May 12, 2026
| <p class="gallery-title">{{ _("Your exhibit URL will look like this") }}</p> | ||
| <div style="display: flex; width: 100%"> | ||
| <label class="url-helper">https://jandig.app/</label> | ||
| <label class="url-helper">{{ request.scheme }}://{{ request.get_host() }}/</label> |
Member
There was a problem hiding this comment.
We probably can use request.host here, but not request.scheme. I've not confirmed it, but SSL termination happens on our elastic load balancer on Amazon, using request.scheme here is probably going to return "http:" and http links are always redirected to https, so this will make all users be redirected once on each link.
We should keep https:// hardcoded to avoid any issues with internal network schemes, and use only the host part to get "dev.jandig.app" or "jandig.app" here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Exhibit detail and create-exhibit pages were rendering URL previews and "share" links with a hardcoded
https://jandig.app/. On dev, an exhibit atdev.jandig.app/exhibit/?id=Nshowed a share URL pointing athttps://jandig.app/<slug>/, sending users away from the dev environment they were testing on.Switch user-facing references to
{{ request.scheme }}://{{ request.get_host() }}/so each environment links to itself. The "See this exhibition" anchor inexhibit_detail.jinja2uses a relative/{slug}path, which avoids the question entirely.Files changed
src/core/jinja2/core/exhibit_detail.jinja2:{{ request.scheme }}://{{ request.get_host() }}/<slug>/{slug}(relative)src/core/jinja2/core/exhibit_create_ar.jinja2/exhibit_create_mr.jinja2:Test plan
dev.jandig.app/exhibit/?id=…: share link readsdev.jandig.app/<slug>and clicking goes todev.jandig.app/<slug>(not production).jandig.app/exhibit/?id=…: share link readsjandig.app/<slug>(unchanged behaviour).Closes #822
https://claude.ai/code/session_01XC1THLWgnGXGf5wgRhdyvB
Generated by Claude Code