Giter Club home page Giter Club logo

Comments (5)

ijpiantanida avatar ijpiantanida commented on June 16, 2024

Hi @skywalkerluc, is your response payload returning a Content-Type header?

Could you paste one of the created tapes?

from talkback.

skywalkerluc avatar skywalkerluc commented on June 16, 2024

We're sending 'content-type': 'application/json', here's a close example to how it's been mounted:

{ meta: { createdAt: '2021-06-17T15:47:32.986Z', host: 'out_of_context_host, reqHumanReadable: true, }, req: { url: 'out_of_context_url', method: 'DELETE', headers: { accept: 'application/json', 'content-type': 'application/json', }, body: { out_of_context_data: 'out_of_context_value' }, }, res: { status: 200, headers: { date: [ 'Thu, 17 Jun 2021 15:47:34 GMT', ], 'content-type': [ 'application/json;charset=UTF-8', ], 'content-length': [ '40', ], connection: [ 'keep-alive', ], 'access-control-allow-headers': [ 'origin, x-requested-with, accept', ], 'access-control-allow-methods': [ 'GET, PUT, POST, DELETE,PATCH', ], 'access-control-allow-origin': [ '*', ], 'access-control-max-age': [ '3628800', ], 'cache-control': [ 'no-store', ], 'content-encoding': [ 'gzip', ], expires: [ 'Thu, 17 Jun 2021 16:47:34 GMT', ], pragma: [ 'no-cache', ], 'strict-transport-security': [ 'max-age=out_of_context_value ; includeSubDomains', ], vary: [ 'Accept-Encoding', ], 'x-content-type-options': [ 'nosniff', ], 'x-e-dc': [ 'azeus', ], 'x-frame-options': [ 'DENY', ], 'x-newrelic-app-data': [ 'out_of_context_data', ], 'x-oidc-token-type': [ 'CLIENT_CREDENTIALS', ], 'x-oidc-user-type': [ 'ANONYMOUS', ], 'x-vcap-request-id': [ 'out_of_context_id', ], 'x-xss-protection': [ '1; mode=block', ], }, body: 'base64 going here', }, }

Hoping this to be clear enough, I can provide some other example or how our mock-server is set up.

from talkback.

ijpiantanida avatar ijpiantanida commented on June 16, 2024

The server seems to be responding with the right headers that would allow talkback to uncompress and show the body in plain text (content-encoding: gzip and content-type: application/json;charset=UTF-8), so I'm not exactly sure of what's going on yet.

What version of talkback are you using?
Any custom decorators?

from talkback.

skywalkerluc avatar skywalkerluc commented on June 16, 2024

So, we're using "talkback": "1.11.1", I know it's kinda old. Maybe updating it to the latest could help somehow?
But no, no decorators involved.

from talkback.

ijpiantanida avatar ijpiantanida commented on June 16, 2024

Ah, I see! Yes, 1.11.1 didn't have support for compressed responses yet.
v1.12.0 which was the next release added that feature.

Unless you are using node <=10, you should be able to jump to the latest version without major issues.

Keep in mind that tapes that were already stored will not get updated.
You will have to either recreate them or manually edit them, if you understand a little bit of the internals of talkback.
In your case, I think it should be enough to add to meta.

resHumanReadable: true,
resUncompressed: true,

and manually making the base64 body a JSON object (not a string).

This sounds like a good future feature, where talkback automatically improves the stored tapes. But I will need to think a little bit more about it.

I will close the issue, but let me know if you are still having problems making it work.
Thanks

from talkback.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.