Commit Graph

943 Commits

Author SHA1 Message Date
Sean McArthur
cbe1176f2c docs(readme): remove unused import
Closes #657
2015-11-17 10:45:44 -08:00
Sean McArthur
6560e9edba Merge pull request #682 from hyperium/fix-win-x86-nounwind
test(windows): disable a panicking test for 32-bit msvc
2015-11-17 10:43:13 -08:00
Sean McArthur
8a5139e95f test(windows): disable a panicking test for 32-bit msvc 2015-11-16 14:01:57 -08:00
Sean McArthur
73319fc670 Merge pull request #681 from Dean4Devil/master
docs(server): Fixing two small typos
2015-11-16 11:55:05 -08:00
Sean McArthur
2bb906ad7f v0.6.16 2015-11-16 10:45:33 -08:00
Dean4Devil
29fc868064 docs(server): Fixing two small typos 2015-11-12 09:44:54 +01:00
Sean McArthur
45b0b884d1 Merge pull request #677 from untitaker/access-control-expose-headers
Add Access-Control-Expose-Headers
2015-11-02 13:22:12 -08:00
Markus Unterwaditzer
f783e9913b feat(headers): Add Access-Control-Expose-Headers
Fix #673
2015-11-02 22:09:49 +01:00
Sean McArthur
becced4ef2 Merge pull request #676 from Ryman/500_on_panic
fix(response): respond with a 500 if a handler panics
2015-11-02 11:05:26 -08:00
Kevin Butler
63c6762c15 fix(response): respond with a 500 if a handler panics 2015-10-29 23:51:59 +00:00
Sean McArthur
9cbf5499a8 Merge pull request #674 from pyfisch/doccomments
style(headers): use regular doc-comments inside macros
2015-10-27 16:04:08 -07:00
Pyfisch
4c756a9304 style(headers): use regular doc-comments inside macros
A bug (rust-lang/rust#23812) in rustc prevented the use of normal
comments inside macros but this has been fixed.
2015-10-27 19:19:05 +01:00
Sean McArthur
d16ef6d9d4 v0.6.15 2015-10-20 17:38:58 -07:00
Sean McArthur
d8d9e3dbb0 Merge pull request #670 from reem/prebound-listener
Add hooks for HttpListener and HttpsListener to be started from existing listeners.
2015-10-18 23:25:40 -07:00
Jonathan Reem
fa0848d421 feat(server): Add hooks for HttpListener and HttpsListener to be started from existing listeners.
This allows Servers to be started on existing TcpListeners.
2015-10-18 19:01:44 -07:00
Sean McArthur
292b4e6dea Merge pull request #664 from huonw/less-genericity
refactor(client): make RequestBuilder non-generic
2015-10-13 22:20:19 -07:00
Sean McArthur
b524adf585 Merge pull request #665 from huonw/nightly
chore(nightly): remove ()'s and fix benchmarks for nightly
2015-10-13 21:28:24 -07:00
Huon Wilson
ff4a607057 refactor(client): make RequestBuilder non-generic
Improve the compile-time of downstream crates that use RequestBuilder,
by not forcing them to remonomorphise and recompile its non-generic
methods when they use it: with this change, they can just call the
precompiled versions in the `hyper` object file(s). The `send` method is
the major culprit here, since it is quite large and complicated.

For an extreme example,

    extern crate hyper;
    fn main() {
        hyper::Client::new().get("x").send().unwrap();
    }

takes ~4s to compile before this patch (i.e. generic RequestBuilder) and
~2s after. (The time spent interacting with LLVM goes from 2.2s to
0.3s.)

BREAKING CHANGE: `RequestBuilder<U>` should be replaced by `RequestBuilder`.
2015-10-14 15:23:55 +11:00
Huon Wilson
d2e9c94cf5 chore(nightly): remove ()'s and fix benchmarks for nightly
Also ensure that `cargo bench` runs successfully on travis; the old
`cargo bench ... || :` has the effect of ignoring any errors in it.
2015-10-14 15:04:15 +11:00
Sean McArthur
579d7355c4 Merge pull request #661 from hyperium/keep-alive-timeout
fix(server): use a timeout for Server keep-alive
2015-10-09 15:29:02 -07:00
Sean McArthur
cdaa2547ed fix(server): use a timeout for Server keep-alive
Server keep-alive is now **off** by default. In order to turn it on, the
`keep_alive` method must be called on the `Server` object.

Closes #368
2015-10-09 15:02:05 -07:00
Sean McArthur
388ddf6f3b Merge pull request #659 from softprops/patch_builder
feat(client): add patch method to Client builder interface
2015-10-02 11:56:27 -07:00
softprops
03827c3156 feat(client): add patch method to Client builder interface 2015-10-01 22:30:52 -04:00
Sean McArthur
79a99eec8c chore(cargo): update httparse to 1.0 2015-09-28 13:04:06 -07:00
Sean McArthur
1fbed4b026 v0.6.14 2015-09-21 14:22:05 -07:00
Sean McArthur
54f084ad86 Merge pull request #656 from psdh/addPartialEqHead
feat(headers): add PartialEq impl for Headers struct
2015-09-21 08:09:51 -07:00
Prabhjyot Singh Sodhi
76cbf38423 feat(headers): add PartialEq impl for Headers struct
compare the raw representations of the headers for the lack of a better alternative
helpful when asserting HttpRequest/ HttpResponse in tests elsewhere
2015-09-17 10:40:10 +05:30
Sean McArthur
b872969880 fix(timeouts): remove rust #![feature] for socket timeouts 2015-09-16 14:30:12 -07:00
Sean McArthur
3d05a90eef v0.6.13 2015-09-11 13:40:38 -07:00
Sean McArthur
9a3b3558c1 Merge pull request #654 from retep998/appveyor
Improve appveyor ci
2015-09-09 22:23:01 -07:00
Peter Atashian
e0b9a11c9c test(windows): Ignore #[should_panic] tests on 32-bit msvc
Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-09-10 00:09:14 -04:00
Peter Atashian
4d7c04e035 test(windows): Improve appveyor ci
Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-09-09 23:17:22 -04:00
Sean McArthur
e9c62ccbab Merge pull request #648 from mlalic/h1-msg-keep-calm
[WIP] Add a stream state enum that makes it impossible to lose a stream
2015-09-09 10:50:37 -07:00
Sean McArthur
a05b2f1abf Merge pull request #649 from mikedilger/server_empty_writer
fix(server): use EmptyWriter for status codes that have no body
2015-09-07 17:58:47 -07:00
Mike Dilger
9b2998bddc fix(server): use EmptyWriter for status codes that have no body
Previously, hyper was defaulting to Chunked which adds a Transfer-Encoding
header, whenever there was no Content-Length header. RFC 7230 section 3.3.1
reads:

   ...
   A server MUST NOT send a Transfer-Encoding header field in any
   response with a status code of 1xx (Informational) or 204 (No
   Content). A server MUST NOT send a Transfer-Encoding header field in
   any 2xx (Successful) response to a CONNECT request
   ...

This commit fixes the cases of 1xx (Informational), 204 (No Content) by
using the EmptyWriter. It also uses EmptyWriter for 304 (NotModified) which
should not have a body.

It does NOT address the case of responses to CONNECT requests, or to HEAD
requests which do not send a body.  These cases cannot be determined using
the data available in the response, and are left for future work.
2015-09-08 09:36:35 +12:00
Marko Lalic
be4e718145 fix(http): Add a stream enum that makes it impossible to lose a stream
This removes a number of possible panics...
2015-09-07 11:05:41 +02:00
Sean McArthur
1b869c4457 Merge pull request #647 from mlalic/issue-646
fix(http): Make sure not to lose the stream when CL is invalid
2015-09-04 16:33:48 -07:00
Marko Lalic
a36e44af7d fix(http): Make sure not to lose the stream when CL is invalid
When the Content-Length header is invalid, the Http11Message ends up
dropping the stream before returning the error. This causes a panic when
the `close_connection` method of the message is used later. This commit
fixes this by saving the stream onto the message instance before
returning the error. A regression test is also included.
2015-09-05 01:12:03 +02:00
Sean McArthur
32e09a0429 fix(client): EofReader by nature means the connection is closed 2015-09-02 09:26:46 -07:00
Sean McArthur
b833f67780 v0.6.12 2015-09-01 18:12:18 -07:00
Sean McArthur
1ddb59418e Merge pull request #642 from mikedilger/thread_hooks
feat(server): Add Handler per-connection hooks
2015-09-01 18:10:18 -07:00
Sean McArthur
8b593691c6 Merge pull request #645 from hyperium/640-invalid-response
fix(client): be resilient to invalid response bodies
2015-09-01 18:09:26 -07:00
Sean McArthur
75c7117020 fix(client): be resilient to invalid response bodies
When an Http11Message knows that the previous response should not
have included a body per RFC7230, and fails to parse the following
response, the bytes are shuffled along, checking for the start of the
next response.

Closes #640
2015-09-01 16:58:51 -07:00
Mike Dilger
6b6182e8c4 feat(server): Add Handler per-connection hooks 2015-09-02 08:45:37 +12:00
Sean McArthur
8dbc38c75a Merge pull request #644 from erickt/serde
Minor serde micro-optimizations
2015-08-31 22:02:30 -07:00
Sean McArthur
ca67013493 Merge pull request #643 from erickt/master
fix "cargo test --features serde-serialization"
2015-08-31 22:02:20 -07:00
Erick Tryzelaar
63608c49c0 fix(examples): "cargo test --features serde-serialization" 2015-08-31 21:49:27 -07:00
Erick Tryzelaar
3a3c8b69a7 refactor(serde): Minor serde micro-optimizations 2015-08-31 21:49:05 -07:00
Sean McArthur
5c7195ab4a fix(http): fix several cases in HttpReader
- reading 0 bytes when SizedReader.remaining is more than 0 returns
"early eof" error
- reading 0 bytes when ChunkedReader.remaining is more than 0 returns
"early eof" error
- if SizedReader.remaining is less than buf.len(), the buf is sliced to
the remaining size
2015-08-31 19:30:52 -07:00
Sean McArthur
93e6d29a5e refactor(buffer): use vec macro in constructor, change trace logs 2015-08-31 19:30:41 -07:00