stricter security test

This commit is contained in:
ccd0 2014-08-23 20:21:33 -07:00
parent ca9e147486
commit 6abbbf00e2
2 changed files with 4 additions and 3 deletions

View File

@ -87,5 +87,6 @@
"https": false,
"software": "foolfuuka",
"boards": ["t"],
"files": ["t"]
"files": ["t"],
"imagehosts": ["http://archive.mawa.re/"]
}]

View File

@ -145,8 +145,8 @@ Get =
{media} = response
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 HTTP so that no referrer is sent to them from an HTTPS page.
delete media[key] unless /^http:\/\//.test media[key]
# 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].match(/^(http:\/\/[^\/]+\/)?/)[0] in url.archive.imagehosts
Get.parseArchivedPost response, boardID, postID, root, context
return true
return false