Skip to content

Commit

Permalink
Redirect requests for binaries within **/Releases/
Browse files Browse the repository at this point in the history
  • Loading branch information
ajhall committed Mar 21, 2024
1 parent 949e35e commit 87182d7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions devyco/modules/releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ def _create_latest(self, entries, path, relpath):
redir = 'RewriteRule ^%s/%s$ %%{ENV:REQUEST_PROTO}://%%{HTTP_HOST}/%s/%s [L,R=302]\n' % (
relpath, link, path, sig)
ret += redir

ret +='''
RewriteCond %{REQUEST_URI} !\.(xml|html)$
RewriteCond %{REQUEST_URI} ^/(.+)/Releases/(.+)$
RewriteRule ^(.*)$ https://storage.googleapis.com/yubico-binaries/%1/releases/%2 [R=301,L]
'''
return ret

def _post_run(self):
Expand Down

0 comments on commit 87182d7

Please sign in to comment.