This project is archived and is in readonly mode.
Removed http header Accept by default
-
Michael Koziarski
- Tag changed from accept, activeresource, formats, header, patch, xml, youtube to accept, activeresource, formats, header, patch, xml, youtube
So what is it about this that breaks the youtube api?
You should be able to override the Accept header to contain the values supported by the api? The 406 reply you're receiving is just because gdata can't reply with that content type:
406 = "Not Acceptable",
-
Edgar Suarez
Yes, it's supposed to be able to change the accept header but it just ignores my header because the method overrides it:
#ActiveResource::Connection def build_request_headers(headers, http_method=nil) authorization_header.update(default_header).update(headers).update(http_format_header(http_method)) end def http_format_header(http_method) {HTTP_FORMAT_HEADER_NAMES[http_method] => format.mime_type} endSo even when I do:
connection.get('/feeds/api/videos?vq=rails', {'Accept' => 'application/xhtml+xml'}) # or any other mime typeIt is overridden with 'application/xml' which is the default mime for the get method.
I've been thinking and actually there should be a cleaner way to fix this (maybe a reverse update), but I just made the patch in hurry in the meantime.
Regards.
-
Michael Koziarski
- Assigned user set to Michael Koziarski
- Milestone changed from 2.x to 2.1.2
OK, so if you can upload a new version of this patch which:
1) Includes a test case (use mocha if it's easier) 2) Does a reverse merge instead
I think we'll be good to go
-
Edgar Suarez
Ok, so good so far... here is the cleaner patch with the proper test using mocha.
Hope it's good enough to go.
-
Michael Koziarski
- Milestone cleared.
I've reverted the change that introduced this from 2-1-stable, so this now needs to be addressed in 2.2.0
-
rbpandey
This seems to have been applied to trunk already. Can this be marked as resolved?
-
Michael Koziarski
- State changed from new to committed
