Skip to content

Commit cb067d6

Browse files
committed
fix: #25
1 parent 8d1f95d commit cb067d6

17 files changed

+20
-17
lines changed

src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ var HTTPSnippet = function (req, lang) {
142142
// update the uri object
143143
this.source.uriObj.query = this.source.queryObj
144144
this.source.uriObj.search = qs.stringify(this.source.queryObj)
145-
this.source.uriObj.path = this.source.uriObj.pathname + '?' + this.source.uriObj.search
145+
146+
if (this.source.uriObj.search) {
147+
this.source.uriObj.path = this.source.uriObj.pathname + '?' + this.source.uriObj.search
148+
}
146149

147150
// construct a full url
148151
this.source.fullUrl = url.format(this.source.uriObj)

test/fixtures/output/node/native/application-form-encoded.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var options = {
44
"method": "POST",
55
"hostname": "mockbin.com",
66
"port": null,
7-
"path": "/har?",
7+
"path": "/har",
88
"headers": {
99
"content-type": "application/x-www-form-urlencoded"
1010
}

test/fixtures/output/node/native/application-json.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var options = {
44
"method": "POST",
55
"hostname": "mockbin.com",
66
"port": null,
7-
"path": "/har?",
7+
"path": "/har",
88
"headers": {
99
"content-type": "application/json"
1010
}

test/fixtures/output/node/native/cookies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var options = {
44
"method": "POST",
55
"hostname": "mockbin.com",
66
"port": null,
7-
"path": "/har?",
7+
"path": "/har",
88
"headers": {
99
"cookie": "foo=bar; bar=baz"
1010
}

test/fixtures/output/node/native/headers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var options = {
44
"method": "GET",
55
"hostname": "mockbin.com",
66
"port": null,
7-
"path": "/har?",
7+
"path": "/har",
88
"headers": {
99
"accept": "application/json",
1010
"x-foo": "Bar"

test/fixtures/output/node/native/multipart-data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var options = {
44
"method": "POST",
55
"hostname": "mockbin.com",
66
"port": null,
7-
"path": "/har?",
7+
"path": "/har",
88
"headers": {
99
"content-type": "multipart/form-data; boundary=---011000010111000001101001"
1010
}

test/fixtures/output/node/native/multipart-file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var options = {
44
"method": "POST",
55
"hostname": "mockbin.com",
66
"port": null,
7-
"path": "/har?",
7+
"path": "/har",
88
"headers": {
99
"content-type": "multipart/form-data; boundary=---011000010111000001101001"
1010
}

test/fixtures/output/node/native/multipart-form-data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var options = {
44
"method": "POST",
55
"hostname": "mockbin.com",
66
"port": null,
7-
"path": "/har?",
7+
"path": "/har",
88
"headers": {
99
"content-type": "multipart/form-data; boundary=---011000010111000001101001"
1010
}

test/fixtures/output/node/native/short.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var options = {
44
"method": "GET",
55
"hostname": "mockbin.com",
66
"port": null,
7-
"path": "/har?",
7+
"path": "/har",
88
"headers": {}
99
};
1010

test/fixtures/output/python/python3/application-form-encoded.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
headers = { 'content-type': "application/x-www-form-urlencoded" }
88

9-
conn.request("POST", "/har?", payload, headers)
9+
conn.request("POST", "/har", payload, headers)
1010

1111
res = conn.getresponse()
1212
data = res.read()

0 commit comments

Comments
 (0)