tenderlove/mechanize — Issue #174: [2.0.1] Mechanize sends https referer to other https sites
Author: kitamomonga
Created: 2011-12-09 01:54:55+00:00
State: open

On Mechanize 2.0.1,

require 'rubygems'; require 'mechanize'
httpagent = Mechanize.new.agent
uri = URI.parse('https://other/')
req = Net::HTTP::Get.new(uri.path)

referer = URI.parse('https://example/')

# build Referer: header
httpagent.request_referer(req, uri, referer)
p req['referer']

shows:

"https://example/"

RFC 2616 mentions nothing about HTTPS->HTTPS access,
http://www.w3.org/Protocols/rfc2616/rfc2616-sec15.html#sec15.1.3
but I think most people do not expect that the web browsers tell HTTPS URL to anyone else.