repo
stringclasses
1 value
pull_number
int64
20
3.81k
instance_id
stringlengths
18
20
issue_numbers
listlengths
1
2
base_commit
stringlengths
40
40
patch
stringlengths
214
153k
test_patch
stringlengths
288
262k
problem_statement
stringlengths
22
7.42k
hints_text
stringlengths
0
66.9k
created_at
stringlengths
20
20
version
stringclasses
21 values
environment_setup_commit
stringclasses
21 values
hyperium/hyper
195
hyperium__hyper-195
[ "194" ]
5e560cb1c10ba9da0f0763253d7c29de6a6675b4
diff --git a/src/header/common/authorization.rs b/src/header/common/authorization.rs --- a/src/header/common/authorization.rs +++ b/src/header/common/authorization.rs @@ -1,6 +1,6 @@ use std::fmt::{mod, Show}; use std::str::{FromStr, from_utf8}; -use serialize::base64::{ToBase64, FromBase64, Standard, Config}; +use s...
diff --git a/src/header/common/etag.rs b/src/header/common/etag.rs --- a/src/header/common/etag.rs +++ b/src/header/common/etag.rs @@ -118,7 +118,7 @@ mod tests { etag = Header::parse_header([b"W/\"\x65\x62\"".to_vec()].as_slice()); assert_eq!(etag, Some(Etag { weak: true, - ta...
Cannot build hyper I can't seem to build hyper: ``` $ cargo build Compiling hyper v0.0.1 (https://github.com/hyperium/hyper#5e560cb1) /home/danilo/.cargo/git/checkouts/hyper-3d407dab77cf6838/master/src/header/common/etag.rs:121:20: 121:25 warning: \U00ABCD12 and \uABCD escapes are deprecated /home/danilo/.cargo/git...
The latest rustc updates seem to have introduced some breaking changes. These same build errors are also holding up a PR I have.
2014-12-12T20:25:31Z
0.0
27b262c22678ed785ed269da4f4a4ddc154526d1
hyperium/hyper
182
hyperium__hyper-182
[ "62" ]
2d6c8819cdf196e1467f162d89da5559570b7705
diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -42,18 +42,18 @@ Client: ```rust fn main() { - // Creating an outgoing request. - let mut req = Request::get(Url::parse("http://www.gooogle.com/").unwrap()).unwrap(); + // Create a client. + let mut client = Client::new(); - // S...
diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -64,22 +64,20 @@ fn main() { [Client Bench:](./benches/client.rs) ``` - running 3 tests -test bench_curl ... bench: 298416 ns/iter (+/- 132455) -test bench_http ... bench: 292725 ns/iter (+/- 167575) -test bench_hyper ... bench: 22281...
Helper function `http_get` In two projects of mine, I've wanted a function with the signature: `fn http_get(url: String) -> Result<(StatusCode, Vec<u8>), SomeError>` I could hack this together with methods currently in Hyper, but I think it would provide value to group it together in a helper function.
I've been thinking that a Request Builder should be provided, to ease making simple requests. Something like rust-curl's interface. I think that the long road for hyper is two or more layers - core hyper, which includes a fast http parser and low-level header and body access and a higher level or levels for both the s...
2014-12-07T07:37:46Z
0.0
27b262c22678ed785ed269da4f4a4ddc154526d1
hyperium/hyper
180
hyperium__hyper-180
[ "170" ]
db2a9f40d8462e7c5550d21716f01d1306edc8c5
diff --git a/src/header/common/mod.rs b/src/header/common/mod.rs --- a/src/header/common/mod.rs +++ b/src/header/common/mod.rs @@ -14,6 +14,7 @@ pub use self::connection::Connection; pub use self::content_length::ContentLength; pub use self::content_type::ContentType; pub use self::date::Date; +pub use self::etag::E...
diff --git /dev/null b/src/header/common/etag.rs new file mode 100644 --- /dev/null +++ b/src/header/common/etag.rs @@ -0,0 +1,156 @@ +use header::{Header, HeaderFormat}; +use std::fmt::{mod}; +use super::util::from_one_raw_str; + +/// The `Etag` header. +/// +/// An Etag consists of a string enclosed by two literal do...
add Etag Header See https://tools.ietf.org/html/rfc7232#section-2.3
2014-12-05T22:22:45Z
0.0
27b262c22678ed785ed269da4f4a4ddc154526d1
hyperium/hyper
166
hyperium__hyper-166
[ "155" ]
0ccd1acaa198488176b74ac97ae5cfc971d816a5
diff --git a/src/header/common/cookie.rs b/src/header/common/cookie.rs --- a/src/header/common/cookie.rs +++ b/src/header/common/cookie.rs @@ -66,11 +66,17 @@ impl Cookies { /// to manipulate cookies and create a corresponding `SetCookie` header afterwards. pub fn to_cookie_jar(&self, key: &[u8]) -> CookieJar...
diff --git a/src/header/common/cookie.rs b/src/header/common/cookie.rs --- a/src/header/common/cookie.rs +++ b/src/header/common/cookie.rs @@ -96,4 +102,15 @@ fn test_fmt() { assert_eq!(headers.to_string()[], "Cookie: foo=bar; baz=quux\r\n"); } +#[test] +fn cookie_jar() { + let cookie = Cookie::new("foo".to_...
CookieJar isn't helpful for clients Currently `Cookies` provides a method to convert to a `CookieJar` and `SetCookies` has a method to be created from a `CookieJar`, which is useful for servers, but clients need methods that do the opposite.
@retep998 To be sure, you need: 1. a conversion from CookieJar to Cookies header; 2. a conversion from SetCookie header to CookieJar; Is it correct? Yes, a way to turn a `CookieJar` into `Cookies` and a way to apply the changes from `SetCookie` to the `CookieJar`. Those two things would make working with cookies sign...
2014-12-02T07:40:32Z
0.0
27b262c22678ed785ed269da4f4a4ddc154526d1
hyperium/hyper
165
hyperium__hyper-165
[ "119" ]
1ed4ea5a279d2b9098a717f2d4b44df0be593669
diff --git a/src/header/common/date.rs b/src/header/common/date.rs --- a/src/header/common/date.rs +++ b/src/header/common/date.rs @@ -1,8 +1,8 @@ -use header::{Header, HeaderFormat}; use std::fmt::{mod, Show}; -use super::util::from_one_raw_str; use std::str::FromStr; -use time::{Tm, strptime}; +use time::Tm; +use h...
diff --git /dev/null b/src/header/common/cache_control.rs new file mode 100644 --- /dev/null +++ b/src/header/common/cache_control.rs @@ -0,0 +1,165 @@ +use std::fmt; +use std::str::FromStr; +use header::{Header, HeaderFormat}; +use super::util::{from_one_comma_delimited, fmt_comma_delimited}; + +/// The Cache-Control ...
Add CacheControl header It's valid to receive multiple `Cache-Control` headers, so this should parse: ``` Cache-Control: no-cache, max-age=0 Cache-Control: no-store ``` into: ``` CacheControl(vec![NoCache, NoStore, MaxAge(0)]) ``` /cc @jdm
Just to be clear, the support for this only needs to come in the parse_header implementation for CacheControl, right? We already support multiple raw header lines. Also is this a `servo` issue? Yes, servo wants it. Also yes, it's just a reminder that `parse_header` cannot ignore multiple lines, like many other heade...
2014-12-02T05:04:50Z
0.0
27b262c22678ed785ed269da4f4a4ddc154526d1
hyperium/hyper
153
hyperium__hyper-153
[ "152" ]
ba758ecde10849298de7660cafd360e3ad662628
diff --git a/src/client/request.rs b/src/client/request.rs --- a/src/client/request.rs +++ b/src/client/request.rs @@ -187,7 +187,7 @@ impl Request<Streaming> { /// /// Consumes the Request. pub fn send(self) -> HttpResult<Response> { - let raw = try!(self.body.end()).unwrap(); + let raw = ...
diff --git a/src/client/request.rs b/src/client/request.rs --- a/src/client/request.rs +++ b/src/client/request.rs @@ -219,8 +219,8 @@ mod tests { Get, Url::parse("http://example.dom").unwrap() ).unwrap(); let req = req.start().unwrap(); - let stream = *req.body.end().unwrap().unwr...
Fix unwrap() => into_inner() This pr also renames Response.unwrap() into Response.into_inner() to match new conventions.
2014-11-27T20:04:06Z
0.0
27b262c22678ed785ed269da4f4a4ddc154526d1
hyperium/hyper
113
hyperium__hyper-113
[ "112" ]
d5982378d140891f5ac15143801ea0d0513808dd
diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -16,9 +16,6 @@ git = "https://github.com/hyperium/mime.rs" [dependencies.unsafe-any] git = "https://github.com/reem/rust-unsafe-any" -[dependencies.intertwine] -git = "https://github.com/reem/rust-intertwine" - [dependencies.move-acceptor] ...
diff --git a/benches/client.rs b/benches/client.rs --- a/benches/client.rs +++ b/benches/client.rs @@ -35,7 +35,7 @@ fn handle(mut incoming: Incoming) { #[bench] fn bench_curl(b: &mut test::Bencher) { let mut listening = listen(); - let s = format!("http://{}/", listening.sockets[0]); + let s = format!("ht...
intertwining is slow Benchmarks with intertwining are in the README. Here's benchmarks with intertwining removed: ``` test bench_http ... bench: 307062 ns/iter (+/- 68288) test bench_hyper ... bench: 233069 ns/iter (+/- 90194) ``` It'd be neat if intertwining itself could be made faster, but at the least, inte...
I've actually just been working on this when it started showing up in profiles and was just about to make a PR, if you already have one ready feel free to make it or I'll just put up mine. I don't have one yet. I had simply reverted out the interwining commit to compare the benchmarks. I'll make the PR then, since I'...
2014-11-11T01:14:38Z
0.0
27b262c22678ed785ed269da4f4a4ddc154526d1
hyperium/hyper
108
hyperium__hyper-108
[ "77" ]
caab60e37401d50b574e015d43090260137afa47
diff --git a/src/client/request.rs b/src/client/request.rs --- a/src/client/request.rs +++ b/src/client/request.rs @@ -7,7 +7,7 @@ use method::{mod, Get, Post, Delete, Put, Patch, Head, Options}; use header::Headers; use header::common::{mod, Host}; use net::{NetworkStream, NetworkConnector, HttpStream, Fresh, Strea...
diff --git a/src/client/request.rs b/src/client/request.rs --- a/src/client/request.rs +++ b/src/client/request.rs @@ -192,3 +199,38 @@ impl Writer for Request<Streaming> { } } +#[cfg(test)] +mod tests { + use std::boxed::BoxAny; + use std::str::from_utf8; + use url::Url; + use method::{Get, Head}; ...
Don't send Chunked for requests that shouldn't have bodies Sounds like `Get`, `Head`, `Options`, `Connect`...
2014-11-10T04:59:55Z
0.0
27b262c22678ed785ed269da4f4a4ddc154526d1
hyperium/hyper
76
hyperium__hyper-76
[ "75" ]
08402a1cbf1f039e817d8b056e9de506584d0304
diff --git a/src/client/request.rs b/src/client/request.rs --- a/src/client/request.rs +++ b/src/client/request.rs @@ -184,4 +190,3 @@ impl Writer for Request<Streaming> { self.body.flush() } } - diff --git a/src/lib.rs b/src/lib.rs --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -#![feature(macro_rule...
diff --git a/src/client/request.rs b/src/client/request.rs --- a/src/client/request.rs +++ b/src/client/request.rs @@ -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<Stream...
Hyper client discards query string when making requests Hi all, Found an issue while using Hyper's HTTP client. When starting the request, Hyper calls `rust-url`'s `serialize_path` function to generate the first header line, but `serialize_path` discards the query string from the URL. This breaks any GET request tha...
If that gets merged into a rust-url, I'd be happy to use it. Until then, I'll just submit a fix to unblock you (or anyone else) right now.
2014-10-13T17:17:18Z
0.0
27b262c22678ed785ed269da4f4a4ddc154526d1
hyperium/hyper
59
hyperium__hyper-59
[ "51" ]
41164fece9d8ae493ba7836c60016d6adc2c3147
diff --git a/src/client/response.rs b/src/client/response.rs --- a/src/client/response.rs +++ b/src/client/response.rs @@ -65,6 +65,11 @@ impl Response { body: body, }) } + + /// Unwraps the Request to return the NetworkStream underneath. + pub fn unwrap(self) -> Box<NetworkStream + Sen...
diff --git a/src/client/response.rs b/src/client/response.rs --- a/src/client/response.rs +++ b/src/client/response.rs @@ -73,3 +78,33 @@ impl Reader for Response { self.body.read(buf) } } + +#[cfg(test)] +mod tests { + use std::boxed::BoxAny; + use std::io::BufferedReader; + + use header::Heade...
Enable raw, possibly unsafe, access to the original Socket Needed by servo. Needed on the server for socket libraries. Also includes handling the `Upgrade` value for `Connection`.
2014-09-25T00:33:50Z
0.0
27b262c22678ed785ed269da4f4a4ddc154526d1
hyperium/hyper
48
hyperium__hyper-48
[ "47", "47" ]
1b65d5e2e60c79bc0b033823e5f7712f073abfa6
diff --git a/src/client/request.rs b/src/client/request.rs --- a/src/client/request.rs +++ b/src/client/request.rs @@ -111,7 +111,7 @@ impl Request<Fresh> { let mut chunked = true; let mut len = 0; - match self.headers.get_ref::<common::ContentLength>() { + match self.headers.get::<com...
diff --git a/src/header/mod.rs b/src/header/mod.rs --- a/src/header/mod.rs +++ b/src/header/mod.rs @@ -341,8 +373,8 @@ mod tests { #[test] fn test_from_raw() { - let mut headers = Headers::from_raw(&mut mem("Content-Length: 10\r\n\r\n")).unwrap(); - assert_eq!(headers.get_ref(), Some(&ContentL...
&'a Headers does not allow reading Headers I've got a branch implementing a `HeadersView` that solves this problem, but right now that means you can't read the Headers of anything `Streaming`. &'a Headers does not allow reading Headers I've got a branch implementing a `HeadersView` that solves this problem, but right ...
Oh right, because it needs to be mutable internally. Maybe Headers could keep a RefCell of the HashMap. It's mutability is just an implementation detail, and shouldn't concern users. That would also improve fighting the borrowck in matches. RefCell would not be a good solution here as it would be a leaky abstraction ...
2014-09-20T11:17:10Z
0.0
27b262c22678ed785ed269da4f4a4ddc154526d1
hyperium/hyper
36
hyperium__hyper-36
[ "35" ]
c40b5b0c53d21d88050af7c702346c5ef5c27e93
diff --git a/src/header/mod.rs b/src/header/mod.rs --- a/src/header/mod.rs +++ b/src/header/mod.rs @@ -7,6 +7,7 @@ use std::ascii::OwnedAsciiExt; use std::char::is_lowercase; use std::fmt::{mod, Show}; +use std::intrinsics::TypeId; use std::mem::{transmute, transmute_copy}; use std::raw::TraitObject; use std::str...
diff --git a/src/header/mod.rs b/src/header/mod.rs --- a/src/header/mod.rs +++ b/src/header/mod.rs @@ -260,6 +269,7 @@ impl fmt::Show for Item { #[cfg(test)] mod tests { use std::io::MemReader; + use std::fmt; use mime::{Mime, Text, Plain}; use super::{Headers, Header}; use super::common::{Cont...
Using a different Header representation can lead to an illegal transmute
The only way around this is to either store the raw representation or store only a single representation and to keep track of what type was used to generate that representation.
2014-09-14T17:27:29Z
0.0
27b262c22678ed785ed269da4f4a4ddc154526d1
hyperium/hyper
29
hyperium__hyper-29
[ "5" ]
4eb48ab7999247f4c696afd2eb105cfa2c6b054b
diff --git a/examples/concurrent-server.rs b/examples/concurrent-server.rs --- a/examples/concurrent-server.rs +++ b/examples/concurrent-server.rs @@ -1,4 +1,4 @@ -#![feature(macro_rules)] +#![feature(macro_rules, default_type_params)] extern crate hyper; extern crate debug; diff --git a/examples/concurrent-server....
diff --git a/benches/client.rs b/benches/client.rs --- a/benches/client.rs +++ b/benches/client.rs @@ -8,8 +8,9 @@ extern crate test; use std::fmt::{mod, Show}; use std::io::net::ip::Ipv4Addr; use hyper::server::{Incoming, Server}; +use hyper::net::HttpAcceptor; -fn listen() -> hyper::server::Listening { +fn liste...
Mocking Request and Response There should be some way to mock Request and Response for testing. Right now, since they contain explicit references to TcpStreams, this is very difficult. This is solvable by creating a trait that abstracts the functionality you need from TCPStream, but this may mean incurring the cost of ...
2014-09-09T21:32:22Z
0.0
27b262c22678ed785ed269da4f4a4ddc154526d1
hyperium/hyper
25
hyperium__hyper-25
[ "7" ]
8e95d4bc42e47ff40df8221bdc4f121f6c1f6084
diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,12 @@ git = "https://github.com/seanmonstar/mime.rs" [dependencies.unsafe-any] git = "https://github.com/reem/rust-unsafe-any" +[dependencies.intertwine] +git = "https://github.com/reem/rust-intertwine" + +[dependencies.move-accepto...
diff --git a/benches/client.rs b/benches/client.rs --- a/benches/client.rs +++ b/benches/client.rs @@ -8,9 +8,8 @@ extern crate test; use std::fmt::{mod, Show}; use std::io::net::ip::Ipv4Addr; use hyper::server::{Incoming, Server}; -use hyper::net::HttpAcceptor; -fn listen() -> hyper::server::Listening<HttpAccepto...
Change Server to allow multiple listens from the same Handler Related to #4, as this will necessitate a slightly different handling of Handler. I should be able to instantiate a Server with a single handler, then make that server listen on multiple ports, all without reconstructing the handler multiple times.
2014-09-09T03:36:52Z
0.0
27b262c22678ed785ed269da4f4a4ddc154526d1
hyperium/hyper
20
hyperium__hyper-20
[ "8" ]
fd6b014e7e40d686121b5cdf63818878d4bf2ce2
diff --git a/examples/server.rs b/examples/server.rs --- a/examples/server.rs +++ b/examples/server.rs @@ -8,7 +8,7 @@ use std::io::net::ip::Ipv4Addr; use hyper::{Get, Post}; use hyper::server::{Server, Handler, Incoming}; -use hyper::header::ContentLength; +use hyper::header::common::ContentLength; struct Echo;...
diff --git a/src/header.rs /dev/null --- a/src/header.rs +++ /dev/null @@ -1,631 +0,0 @@ -//! Headers container, and common header fields. -//! -//! hyper has the opinion that Headers should be strongly-typed, because that's -//! why we're using Rust in the first place. To set or get any header, an object -//! must imp...
Common headers should go in their own submodules Instead of being inlined in hyper/header.rs Since it is very unergonomic to use a Header if it is not implemented, it's also important that basically all common headers have to be implemented here.
2014-09-08T23:20:46Z
0.0
27b262c22678ed785ed269da4f4a4ddc154526d1