File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -264,6 +264,11 @@ def get_absolute_url(self):
264264 self .__unicode__ ()
265265 )
266266
267+ def get_signed_url (self ):
268+ return 'https://files.phpmyadmin.net{0}.asc' .format (
269+ self .__unicode__ ()
270+ )
271+
267272 def get_alternate_url (self ):
268273 return 'https://1126968067.rsc.cdn77.org{0}' .format (
269274 self .__unicode__ ()
@@ -314,6 +319,13 @@ def get_absolute_url(self):
314319 self .filename ,
315320 )
316321
322+ def get_signed_url (self ):
323+ return 'https://files.phpmyadmin.net/themes/{0}/{1}/{2}.asc' .format (
324+ self .name ,
325+ self .version ,
326+ self .filename ,
327+ )
328+
317329 def get_filesystem_path (self ):
318330 return os .path .join (
319331 settings .FILES_PATH ,
Original file line number Diff line number Diff line change @@ -84,12 +84,15 @@ def version_json(request):
8484 )
8585
8686
87- def latest_download (request , flavor , extension ):
87+ def latest_download (request , flavor , extension , checksum = None ):
88+ print checksum
8889 latest = Release .objects .filter (stable = True )[0 ]
8990 try :
9091 result = latest .download_set .get (
9192 filename__endswith = '-{0}{1}' .format (flavor , extension )
9293 )
94+ if checksum == '.asc' :
95+ return redirect (result .get_signed_url (), permanent = False )
9396 return redirect (result , permanent = False )
9497 except Download .DoesNotExist :
9598 raise Http404 ("No release found matching the query" )
Original file line number Diff line number Diff line change 339339 url (
340340 r'^downloads/phpMyAdmin-latest-'
341341 r'(?P<flavor>all-languages|english)'
342- r'(?P<extension>\.zip|\.tar\.gz|\.tar\.xz|\.tar\.bz2)$' ,
342+ r'(?P<extension>\.zip|\.tar\.gz|\.tar\.xz|\.tar\.bz2)'
343+ r'(?P<checksum>\.asc)?$' ,
343344 latest_download ,
344345 ),
345346 url (
You can’t perform that action at this time.
0 commit comments