diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 623ffb992..26cea68ad 100755 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -300,7 +300,6 @@ module.exports = (grunt) -> nonstandard: true # XXX Temporarily suppress lots of existing warnings until we fix them. '-W018': true - '-W053': true '-W084': true '-W083': true '-W093': true diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index f46eab0ae..a626098dc 100755 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -59,10 +59,9 @@ Redirect = # For fuuka-based archives: # https://github.com/eksopl/fuuka/issues/27 protocol = Redirect.protocol archive - URL = new String "#{protocol}#{archive.domain}/_/api/chan/post/?board=#{boardID}&num=#{postID}" + URL = "#{protocol}#{archive.domain}/_/api/chan/post/?board=#{boardID}&num=#{postID}" return '' unless Redirect.securityCheck URL - URL.archive = archive URL file: (archive, {boardID, filename}) -> diff --git a/src/General/lib/fetcher.class b/src/General/lib/fetcher.class index 798084253..d466e95b7 100644 --- a/src/General/lib/fetcher.class +++ b/src/General/lib/fetcher.class @@ -79,12 +79,13 @@ class Fetcher archivedPost: -> return false unless Conf['Resurrect Quotes'] return false unless url = Redirect.to 'post', {@boardID, @postID} + archive = Redirect.data.post[@boardID] if /^https:\/\//.test(url) or location.protocol is 'http:' $.cache url, do (self = @) -> -> self.parseArchivedPost @response, url , responseType: 'json' - withCredentials: url.archive.withCredentials + withCredentials: archive.withCredentials return true else if Conf['Except Archives from Encryption'] CrossOrigin.json url, (response) => @@ -92,7 +93,7 @@ class Fetcher if media then for key of media when /_link$/.test key # Image/thumbnail URLs loaded over HTTP can be modified in transit. # Require them to be from a known HTTP host so that no referrer is sent to them from an HTTPS page. - delete media[key] unless media[key]? and media[key].match(/^(http:\/\/[^\/]+\/)?/)[0] in url.archive.imagehosts + delete media[key] unless media[key]? and media[key].match(/^(http:\/\/[^\/]+\/)?/)[0] in archive.imagehosts @parseArchivedPost response, url return true return false