We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c450d46 commit 2701405Copy full SHA for 2701405
src/libhttp/client/request.rs
@@ -203,8 +203,15 @@ impl RequestWriter<TcpStream> {
203
// TODO: get to the point where we can say HTTP/1.1 with good conscience
204
// XXX: Rust's current lack of statement-duration lifetime handling prevents this from being
205
// one statement ("error: borrowed value does not live long enough")
206
- // TODO: don't send the entire URL; just url.{path, query}
207
- let s = format!("{} {} HTTP/1.0\r\n", self.method.to_str(), self.url.to_str());
+ let s = format!("{} {}{}{} HTTP/1.0\r\n",
+ self.method.to_str(),
208
+ self.url.path,
209
+ if self.url.query.len() > 0 {
210
+ "?"
211
+ } else {
212
+ ""
213
+ },
214
+ self.url.query.to_str());
215
self.stream.write(s.as_bytes());
216
217
self.headers.write_all(&mut self.stream);
0 commit comments