RSS responses are saved as binary data rather than text #53

Closed
cressie176 opened this Issue May 1, 2012 · 2 comments

Comments

Projects
None yet
2 participants

I tried using betamax to cache the RSS response from a Jenkins build. Everything worked OK apart from the tape stored the response as binary rather than text, meaning I couldn't edit it to customise the RSS response.

!tape
name: Jenkins RSS
interactions:

  • recorded: 2012-05-01T10:15:18.983Z
    request:
    method: GET
    uri: http://build.acuminous.meh:8080/job/Jinkies/rssAll
    headers:
    Accept: text/html, image/gif, image/jpeg, ; q=.2, */; q=.2
    Host: build.acuminous.meh:8080
    Proxy-Connection: keep-alive
    User-Agent: Java/1.6.0_29
    response:
    status: 200
    headers:
    Content-Type: application/atom+xml;charset=UTF-8
    Date: Tue, 01 May 2012 10:09:06 GMT
    body: !!binary |-
    PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVV...
Collaborator

robfletcher commented May 1, 2012

The MemoryTape class assumes that any content that is not text/*, application/json or application/javascript should be stored as binary. This should probably be extended for other MIME types and made customisable.

Collaborator

robfletcher commented Aug 17, 2012

I think for now I'm going to add application/(\w+\+)?xml to the text mime type patterns. If there are a lot of requests for other formats I'll make it customizable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment