Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/jinja2/core/exhibit_create_ar.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<h3>{{ _("Exhibit Link") }}</h3>
<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>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

<p id="exhibit-slug-field" style="float: right; width: 65%">{{ form.visible_fields()[1] }}</p>
</div>
{{ form.visible_fields()[1] .errors }}
Expand Down
2 changes: 1 addition & 1 deletion src/core/jinja2/core/exhibit_create_mr.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<h3>{{ _("Exhibit Link") }}</h3>
<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>
<p id="exhibit-slug-field" style="float: right; width: 65%">{{ form.visible_fields()[1] }}</p>
</div>
{{ form.visible_fields()[1] .errors }}
Expand Down
4 changes: 2 additions & 2 deletions src/core/jinja2/core/exhibit_detail.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<div class="exhibit-detail-box flex">
<h1 class="exhibit-name">{{ exhibit.name }}</h1>
<p class="url">
https://jandig.app/<span>{{ exhibit.slug }}</span>
{{ request.scheme }}://{{ request.get_host() }}/<span>{{ exhibit.slug }}</span>
</p>
<p class="by">
{{ _("Created by ") }} <b>{{ exhibit.owner.user.username }}</b>
</p>
<a href="https://jandig.app/{{ exhibit.slug }}" class="gotoExb">{{ _("See this exhibition") }}</a>
<a href="/{{ exhibit.slug }}" class="gotoExb">{{ _("See this exhibition") }}</a>
</div>
{% if artworks %}
<h1 class="titArt">{{ _("Exhibition Artworks") }}</h1>
Expand Down
Loading