cloudfoundry/vcap — Issue #174: TypeError: can't convert Array to String in app_connection.rb#L36 (router component)
Author: achied
Created: 2012-01-30 14:23:27+00:00
State: open

I found an issue (deploying jasper application) processing headers in [on_headers_complete_method](https://github.com/cloudfoundry/vcap/blob/master/router/lib/router/app_connection.rb#L35)

Looking for JSESSIONID run the following exception:

`TypeError: can't convert Array to String`

@headers value is:

@headers = {"Server"=>"Apache-Coyote/1.1", "Set-Cookie"=>["userLocale=es_ES;Expires=Tue, 31-Jan-2012 13:26:48 GMT;HttpOnly", "userTimezone=Etc/UTC;Expires=Tue, 31-Jan-2012 13:26:48 GMT;HttpOnly", "JSESSIONID=86EC794DC333C091FABDDFDDE3B1C968; Path=/"], "Location"=>"", "Content-Length"=>"0", "Date"=>"Mon, 30 Jan 2012 13:26:48 GMT", "Connection"=>"close"} => {"Server"=>"Apache-Coyote/1.1", "Set-Cookie"=>["userLocale=es_ES;Expires=Tue, 31-Jan-2012 13:26:48 GMT;HttpOnly", "userTimezone=Etc/UTC;Expires=Tue, 31-Jan-2012 13:26:48 GMT;HttpOnly", "JSESSIONID=86EC794DC333C091FABDDFDDE3B1C968; Path=/"], "Location"=>"", "Content-Length"=>"0", "Date"=>"Mon, 30 Jan 2012 13:26:48 GMT", "Connection"=>"close"}

```
check_sticky_session = STICKY_SESSIONS =~ headers[SET_COOKIE_HEADER]
# may be wrong because "Set-Cookie" value is an Array not a String.
```

I workaround with a minimal modifcation

```
check_sticky_session = STICKY_SESSIONS =~ headers[SET_COOKIE_HEADER].to_s
```

I can do a pull request if you need it