Move tests on image filename before redirecting to more appropriate place.

This commit is contained in:
ccd0 2019-07-10 16:46:28 -07:00
parent 566c8bffd0
commit 32ebd6a318
2 changed files with 5 additions and 2 deletions

View File

@ -127,7 +127,11 @@ Redirect =
url
file: (archive, {boardID, filename}) ->
filename = encodeURIComponent $.unescape decodeURIComponent filename if boardID is 'f'
return '' unless filename
if boardID is 'f'
filename = encodeURIComponent $.unescape decodeURIComponent filename
else
return '' if /[sm]\.jpg$/.test(filename)
"#{Redirect.protocol archive}#{archive.domain}/#{boardID}/full_image/#{filename}"
board: (archive, {boardID}) ->

View File

@ -157,7 +157,6 @@ Main =
return
if ImageHost.test hostname
return unless pathname[2] and not /[sm]\.jpg$/.test(pathname[2])
$.asap (-> d.readyState isnt 'loading'), ->
if Conf['404 Redirect'] and g.SITE.is404?()
Redirect.navigate 'file', {