We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For example having the following setup and tapes:
index.js
const talkback = require("talkback"); const opts = { host: "https://example.com", }; const server = talkback(opts); server.start(() => console.log("Talkback Started"));
tapes/quotes.json5
{ meta: { createdAt: '2019-03-19T22:03:41.814Z', host: 'https://example.com', resHumanReadable: true, }, req: { url: '/test.json', method: 'GET', headers: { accept: '*/*', 'user-agent': 'curl', }, body: '', }, res: { status: 200, headers: { 'content-type': [ 'application/json; charset=UTF-8', ], date: [ 'Tue, 19 Mar 2019 22:03:42 GMT', ], expires: [ 'Tue, 26 Mar 2019 22:03:42 GMT', ], 'last-modified': [ 'Tue, 19 Mar 2019 22:00:27 GMT', ], 'content-length': [ '46', ], connection: [ 'close', ], }, body: { words: 'in special “quotes” break', }, }, }
node index.js
curl -v -H 'User-Agent: curl' http://localhost:8080/test.json
Returns
* Excess found in a non pipelined read: excess = 4, size = 42, maxdownload = 42, bytecount = 0
{ "words": "in special “quotes” brea
tapes/emojis.json5
{ meta: { createdAt: '2019-03-19T22:03:41.814Z', host: 'https://example.com', resHumanReadable: true, }, req: { url: '/test2.json', method: 'GET', headers: { accept: '*/*', 'user-agent': 'curl', }, body: '', }, res: { status: 200, headers: { 'content-type': [ 'application/json; charset=UTF-8', ], date: [ 'Tue, 19 Mar 2019 22:03:42 GMT', ], expires: [ 'Tue, 26 Mar 2019 22:03:42 GMT', ], 'last-modified': [ 'Tue, 19 Mar 2019 22:00:27 GMT', ], 'content-length': [ '33', ], connection: [ 'close', ], }, body: { emojis: 'also 😢 break', }, }, }
curl -v -H 'User-Agent: curl' http://localhost:8080/test2.json
* Excess found in a non pipelined read: excess = 2, size = 31, maxdownload = 31, bytecount = 0
{ "emojis": "also 😢 break"
Notice how the response is malformed and missing the closing brackets and objects.
A workaround is to remove the response content-length.
content-length
The text was updated successfully, but these errors were encountered:
Hi @sebflipper, I just released v1.10.0 which includes this fix. Thanks for the contribution.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
For example having the following setup and tapes:
index.js
tapes/quotes.json5
node index.js
curl -v -H 'User-Agent: curl' http://localhost:8080/test.json
Returns
* Excess found in a non pipelined read: excess = 4, size = 42, maxdownload = 42, bytecount = 0
tapes/emojis.json5
curl -v -H 'User-Agent: curl' http://localhost:8080/test2.json
Returns
* Excess found in a non pipelined read: excess = 2, size = 31, maxdownload = 31, bytecount = 0
Notice how the response is malformed and missing the closing brackets and objects.
A workaround is to remove the response
content-length
.The text was updated successfully, but these errors were encountered: