diff --git a/core-packages/http/lib/index.jsx b/core-packages/http/lib/index.jsx index fa19f7f..f5cc9a6 100644 --- a/core-packages/http/lib/index.jsx +++ b/core-packages/http/lib/index.jsx @@ -347,7 +347,12 @@ function HTTPRequest (method, url, timeout) { // request line var head = []; var url = this.url(); - var path = url.pathname + url.search; + var path; + if (url.search) { + path = url.pathname + url.search; + } else { + path = url.pathname; + } var request_line = "{} {} HTTP/1.1".format(this.method(), path || "/"); head.push(request_line); // headers to string (kv) form @@ -575,4 +580,4 @@ function HTTPResponse (method, encoding, request) { * However, before we could consider this optimization, we'd need to optimize the ByteString class, * and in particular make it possible and fast to concatenate / add in string data to an existing * byte class. Then we could process the data parts we receive on the fly rather than post-hoc. - */ \ No newline at end of file + */