Skip to content

Commit 4d62071

Browse files
Update PDF redirect URLs to use the new versioned path (#4293)
1 parent 7764aad commit 4d62071

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/server/routes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,4 +254,4 @@ def redirect_old_hero_images(folder, image):
254254
# Redirect requests for the pdfs to GitHub
255255
@app.route("/static/pdfs/<pdf>")
256256
def redirect_pdfs(pdf):
257-
return redirect("https://cdn.httparchive.org/almanac/ebooks/%s" % (pdf)), 301
257+
return redirect("https://cdn.httparchive.org/v1/static/almanac/ebooks/%s" % (pdf)), 301

src/server/tests/routes_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def test_render_pdf_redirect(client):
203203
client,
204204
"/static/pdfs/web_almanac_2019_en_cover_A5.pdf",
205205
301,
206-
"https://cdn.httparchive.org/almanac/ebooks/web_almanac_2019_en_cover_A5.pdf",
206+
"https://cdn.httparchive.org/v1/static/almanac/ebooks/web_almanac_2019_en_cover_A5.pdf",
207207
)
208208

209209

src/templates/base/base.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@
249249
{% endif %}
250250

251251
{% if ebook_size_in_mb and ebook_size_in_mb > 0 %}
252-
<option value="https://cdn.httparchive.org/almanac/ebooks/web_almanac_{{ year }}_{{ lang }}.pdf" data-event="ebook-click">
252+
<option value="https://cdn.httparchive.org/v1/static/almanac/ebooks/web_almanac_{{ year }}_{{ lang }}.pdf" data-event="ebook-click">
253253
{{ self.ebook_download_short() }}
254254
</option>
255255
{% endif %}
@@ -378,7 +378,7 @@
378378
<a href="{{ url_for('table_of_contents', year=year, lang=lang, _anchor='ebook') }}">{{ self.ebook_title() }}</a>
379379
</li>
380380
<li class="nav-dropdown-list-chapter ebook">
381-
<a href="https://cdn.httparchive.org/almanac/ebooks/web_almanac_{{ year }}_{{ lang }}.pdf" data-event="ebook-click" data-label="toc-menu">{{ self.ebook_download_short() }}</a>
381+
<a href="https://cdn.httparchive.org/v1/static/almanac/ebooks/web_almanac_{{ year }}_{{ lang }}.pdf" data-event="ebook-click" data-label="toc-menu">{{ self.ebook_download_short() }}</a>
382382
</li>
383383
{% endif %}
384384
</ul>

src/templates/base/table_of_contents.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ <h2 id="appendices" class="part-name"><a href="#appendices" class="anchor-link">
158158
<h2 id="ebook" class="part-name"><a href="#ebook" class="anchor-link">{{ self.ebook_title() }}</a></h2>
159159
<div class="chapters">
160160
<div class="chapter">
161-
<a href="https://cdn.httparchive.org/almanac/ebooks/web_almanac_{{ year }}_{{ lang }}.pdf" data-event="ebook-click" data-label="toc-page">{{ self.ebook_download() }}</a><br>
161+
<a href="https://cdn.httparchive.org/v1/static/almanac/ebooks/web_almanac_{{ year }}_{{ lang }}.pdf" data-event="ebook-click" data-label="toc-page">{{ self.ebook_download() }}</a><br>
162162
<small>{{ self.ebook_download_note() }}</small>
163163
</div>
164164
</div>

0 commit comments

Comments
 (0)