Comments (5)
Hi @skywalkerluc, is your response payload returning a Content-Type header?
Could you paste one of the created tapes?
from talkback.
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.
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.
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.
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)
- Error when trying to connect to an https with self-signed certificate HOT 1
- Key order matters when comparing requests HOT 3
- It would be great for Talkback to gain an optional mode of operation that's compatible with Servirtium
- Match headers HOT 1
- Feature / Idea(s): Expose lower level APIs HOT 4
- Multiple hosts support? HOT 7
- Requests fail on Node v15.2.1 HOT 4
- Question: Can users add arbitrary properties to `meta`? HOT 2
- How to stop the server on CI? HOT 4
- Potential Feature Request: Consider only specific headers? HOT 2
- Disable header matching or provide a matcher HOT 1
- When starting multiple servers the logging does not use the server name provided in options HOT 2
- How to decode the body in request part of the tape? HOT 3
- TapeMatchers doesn't consider difference in protocol HOT 5
- Logo for talkback HOT 1
- bug: tapes aren't recorded with human readable body HOT 6
- ng-talkback vs talkback HOT 2
- Preserving the order of requests for each tests HOT 1
- Numbering can cause errors if previous tape was deleted HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from talkback.