ezsystems/ezpublish-kernel — pull request #801 by yannickroger (2014-04-14 07:20:27+00:00)
Title: Fix EZP-22414: Session is lost when redirecting from a legacy module

Link: https://jira.ez.no/browse/EZP-22414

## Description
This bug has been fixed in #780

But header could be duplicated in the response.
Calling a legacy extension: `$curl -v http://eng.52ezdemohost.com/paidcontent/metered`

Would display (with duplicate Location header):
```
* About to connect() to eng.52ezdemohost.com port 80 (#0)
* Trying 127.0.0.1... connected
> GET /paidcontent/metered HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: eng.52ezdemohost.com
> Accept: */*
>
< HTTP/1.1 302 Found
< Date: Tue, 01 Apr 2014 17:21:42 GMT
< Server: Apache/2.2.22 (Ubuntu)
< X-Powered-By: eZ Publish Platform
< Expires: Mon, 26 Jul 1997 05:00:00 GMT
< Last-Modified: Tue, 01 Apr 2014 17:21:42 GMT
< Cache-Control: no-cache, must-revalidate
< Pragma: no-cache
< Served-by: eng.52ezdemohost.com
< Content-language: en-GB
< Set-Cookie: eZSESSID=dpkrpame3rq5gsbdbas9ff94a7; path=/
< Location: http://eng.52ezdemohost.com/
< Cache-Control: no-cache
< Location: http://eng.52ezdemohost.com/
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=UTF-8
```

## Fix description
This PR fixes the problem by extending the SF RedirectResponse and adding header methods of the LegacyResponse.

## Tests
Manual tests using curl, sanity check on master and updated unit tests.