nock mixes usage of qs and querystring
See original GitHub issueIt appears nock
mixes usage of native node querystring
module and npm installed qs
module for parsing querystring-like objects.
In nock/lib/interceptor.js
it requires qs
(a dependency in package.json), but in nock/lib/match_body.js
it requires querystring
, the native node library.
These two libraries have different outputs. For example:
var query = require('querystring');
var qs = require('qs');
query.parse('a%5Bb%5D=test'); // => { 'a[b]': 'test' }
qs.parse('a%5Bb%5D=test'); // => { a: { b: 'test' } }
This means interceptors and body matchers have different behavior.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
node.js - what the difference between qs and querystring
Let's check them together: Query String. The querystring module provides utilities for parsing and formatting URL query strings.
Read more >Nock: No match for request
It appears nock mixes usage of native node querystring module and npm installed qs module for parsing querystring-like objects.. In nock/lib/interceptor.js ...
Read more >Untitled
Izgradnja jeftine vikendice, Magis cyborg wicker, 3 monumentos del estado de mexico, Otario q significa! Telefono de llamagas en lima!
Read more >Turning the Querystring into a JSON object using JavaScript
The final step is really easy, all we need to do is use the JSON.stringify method to parse the object, and then call...
Read more >34602 – mod_rewrite fails to correctly deal with URLS that ...
QS, core unescapes URL but not QS, and rewrite escapes both the URL and QS ... My RewriteRule should be expected to leave...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think native ‘querystring’
see https://github.com/nock/nock/pull/563#issuecomment-338104773
🎉 This issue has been resolved in version 11.0.0 🎉
The release is available on:
Your semantic-release bot 📦🚀