Changing the redirect header to use 'Location' rather than 'location'
breaks integration tests that use follow_redirect. Look at
integration.rb:279 (parse_result):
@headers = Hash.new { |h,k| h[k] = }
headers.each_line do |line|
key, value = line.strip.split(/:\s*/, 2)
@headers[key.downcase] << value
end
For some reason header keys as returned from the result are all
downcased, which means that 'location' rather than 'Location' is set
in the response header. So, now 'Location' is nil and I get URI parse
errors.
Changing the redirect header to use 'Location' rather than 'location'
breaks integration tests that use follow_redirect. Look at
integration.rb:279 (parse_result):
Well, the header isn't the problem it's the change in integration.rb.
Normalising http headers is reasonably common, I believe the servlet
API does it too (enterprise!).
If changing that line back to location fixes it, then we can just commit that.
I think this change should be backed out. Especially since the
ActionController tests don't pass.
At this point dealing with the cascade effects of getting rid of the
downcase is going to be pretty messy. This isn't the sort of change you
want to be making in a release candidate.
I agree the problem isn't in parse_result, the problem is in the
changeset (which changed the header to Location instead of location).
Either way, if the AP tests pass when the change is made things should
work, one way or another.
I think this change should be backed out. Especially since the
ActionController tests don't pass.
At this point dealing with the cascade effects of getting rid of the
downcase is going to be pretty messy. This isn't the sort of change you
want to be making in a release candidate.
What went before it was worse. We'd set "Status" but "location".
Getting one style for headers is much easier to deal with when you
reason about what should be done to the lot of them. So let's fix the
tests and any trouble arising from this.