sul-dlss-deprecated / triannon

Rails engine for working with storage of OpenAnnotations stored in Fedora4
Other
13 stars 1 forks source link

POST response has a content-type header that triannon-client doesn't parse correctly #232

Closed dazza-codes closed 9 years ago

dazza-codes commented 9 years ago

When running the DMS annos against triannon-dev on the dms-dev system, the rest-client response contains a content type header like this:

response.headers[:content_type]
=> "[\"application/ld+json\"]; charset=utf-8"

Is this a valid header value?

At the moment, this throws a spanner in the works for the DMS ETL. This does not occur on a localhost triannon running on ruby WebBrick, so maybe it's specific to running on Apache Passenger? In case it helps diagnose it, the full headers are:

response.headers
=> {:date=>"Sat, 08 Aug 2015 01:05:04 GMT",
 :server=>"Apache/2.2.15 (Red Hat)",
 :x_frame_options=>"SAMEORIGIN",
 :x_xss_protection=>"1; mode=block",
 :x_content_type_options=>"nosniff",
 :cache_control=>"no-cache",
 :x_request_id=>"02846c7a-8a2f-40f1-b720-9a0d353fc625",
 :x_runtime=>"0.031306",
 :x_powered_by=>"Phusion Passenger 4.0.49",
 :set_cookie=>["request_method=POST; path=/"],
 :strict_transport_security=>"max-age=31536000; includeSubDomains",
 :access_control_allow_origin=>"*",
 :transfer_encoding=>"chunked",
 :content_type=>"[\"application/ld+json\"]; charset=utf-8"}
dazza-codes commented 9 years ago

@azaroth42 and @ndushay - this is a blocker for DMS ETL and wondering whether to fix it in the triannon-client (if the header value is OK) or fix it in triannon.

dazza-codes commented 9 years ago

This could be a red-herring, because my client code is bumping into a problem with cookie handling when the rack-cache is enabled for rest-client/rest-client-components handing of authentication responses. I'll first try to figure that out and re-open if that doesn't fix it.

dazza-codes commented 9 years ago

https://github.com/rest-client/rest-client/issues/411