LinkedInAttic / sepia

Sepia is a VCR-like module for node.js that records HTTP interactions, then plays them back exactly like the first time they were invoked
Apache License 2.0
279 stars 32 forks source link

Fix http.request options to use search field in url.format #3

Closed CrabDude closed 10 years ago

CrabDude commented 10 years ago

Broken in 0.8.26+.

http.request(options) does not support the 'search' or 'qs' fields, so the '?' is passed in the path. However, in urlFromHttpRequestOptions we use the path (with '?') for pathname in url.format which gets encoded in 0.8.26+ resulting in a fixture miss.

avik-das commented 10 years ago

Can you please add some tests in test/util.js? That way, we codify this behavior and prevent the logic from breaking in future changes. Thanks!

CrabDude commented 10 years ago

Done. Failing before the fix is added in 0.8.26 and passing afterwards.