fix client requests dropping the query string. fixes #75

This commit is contained in:
Sean McArthur
2014-10-13 10:16:45 -07:00
parent 08402a1cbf
commit 61e18141be
2 changed files with 8 additions and 3 deletions

View File

@@ -101,7 +101,13 @@ impl Request<Fresh> {
/// Consume a Fresh Request, writing the headers and method,
/// returning a Streaming Request.
pub fn start(mut self) -> HttpResult<Request<Streaming>> {
let uri = self.url.serialize_path().unwrap();
let mut uri = self.url.serialize_path().unwrap();
//TODO: this needs a test
if let Some(ref q) = self.url.query {
uri.push('?');
uri.push_str(q[]);
}
debug!("writing head: {} {} {}", self.method, uri, self.version);
try_io!(write!(self.body, "{} {} {}", self.method, uri, self.version))
try_io!(self.body.write(LINE_ENDING));
@@ -184,4 +190,3 @@ impl Writer for Request<Streaming> {
self.body.flush()
}
}

View File

@@ -1,4 +1,4 @@
#![feature(macro_rules, phase, default_type_params)]
#![feature(macro_rules, phase, default_type_params, if_let, slicing_syntax)]
#![deny(missing_doc)]
#![deny(warnings)]
#![experimental]