Fix #5012: Fc2 image link paste not uploading.
Fix referer spoofing not working for certain fc2.com image URLs. Spoofing the referer like this redirects to an HTML error page: * curl -H "Referer: http://wwwew.web.fc2.com" http://wwwew.web.fc2.com/e/405.jpg Spoofing it like this works: * curl -H "Referer: http://wwwew.web.fc2.com/e/405.jpg" http://wwwew.web.fc2.com/e/405.jpg
This commit is contained in:
@@ -6,7 +6,7 @@ module Danbooru
|
||||
HTTP::Options.register_feature :spoof_referrer, self
|
||||
|
||||
def perform(request, &block)
|
||||
request.headers["Referer"] = request.uri.origin unless request.headers["Referer"].present?
|
||||
request.headers["Referer"] = request.uri unless request.headers["Referer"].present?
|
||||
response = yield request
|
||||
response
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user