Marko Lalic
b6a10e5c1e
Fix chunk size parsing: handle invalid chunk sizes
...
Currently, when the chunk size was an invalid hex number (i.e.
contained a non-HEX octet), hyper would halt its parsing at the
last valid hex digit and report this as the chunk size.
For example, the following would be the chunk sizes reported for
some strings:
"X" => 0
"1X" => 1
"aY" => 10
"a;a" => 10 (only this should be correct!)
This fix makes it so that any chunk size, which cannot be parsed
as a valid hex number, causes an IoError. Additionally, the case
where the chunk size is followed by a chunk extension is also
handled (since the ";" token is a valid delimiter between the
chunk size and, as such, along with a LWS octet, represents a
valid terminal character of the chunk size).
Regression tests for the `get_chunk_size` function and included.
2015-01-06 21:47:07 +01:00
Pyfisch
0f781efd7b
Merge branch 'master' into accesscontrol
2015-01-06 20:37:23 +01:00
Sean McArthur
23aeb4993a
fix writing raw headers, quality_item
2015-01-05 19:16:34 -08:00
Jonathan Reem
93fcd05b9d
Miscellaneous fixes and test updates for all the other changes
...
- http::LINE_ENDING is now an &'static str
2015-01-06 01:15:47 +01:00
Jonathan Reem
66aa08ecdd
Make downcasting inherent methods on NetworkStream.
2015-01-06 01:15:32 +01:00
Jonathan Reem
f0fe878ec8
More Rust updates:
...
- Some stray deriving -> derive changes
- use::{mod} -> use::{self}
- fmt.write -> fmt.write_str
This does not catch the last case of fmt.write_str in the
Show impl of a Header Item. This will need to be changed
separately.
2015-01-05 22:50:10 +01:00
Pyfisch
60ada12b3c
Added AccessControl* family of headers.
...
Fixes #169
2015-01-04 12:04:32 +01:00
Jonathan Reem
7f3a33f903
#[deriving] -> #[derive]
2015-01-03 20:31:48 +01:00
Jonathan Reem
541e21dbd1
Update for unsafe-any changes.
2015-01-03 20:31:20 +01:00
Pyfisch
76126fc6c7
feat(headers): adds Accept
...
Moved utils to shared/. Added quality_value.
2015-01-03 11:06:38 -08:00
Nerijus Arlauskas
0270c82786
Update to use new array syntax.
2015-01-03 00:01:27 +02:00
Sean McArthur
2251b3b918
fix(rustup): unchecked_get
...
Closes #219
Closes #222
2015-01-02 13:25:41 -08:00
Michael Kovalchik
5dd4529165
Use renamed unsafe_get and concat_vec methods.
...
Changed calls to unsafe_get to use get_unchecked and calls to concat_vec
to use concat to avoid deprecation lints.
2015-01-02 13:18:48 -08:00
Andrey Davydov
4a7696280f
compilation fix
...
compilation fix for rust version "rustc 0.13.0-nightly (7608dbad6 2014-12-31 10:06:21 -0800)"
2015-01-01 10:58:50 +03:00
Antti Keränen
05ddfd10a2
Changed deprecated trim_chars to trim_matches
2014-12-30 16:22:45 +02:00
Sean McArthur
451074b0a6
rust upgrade
2014-12-29 17:42:48 -08:00
Sean McArthur
f75e9bfaaa
Merge pull request #215 from pyfisch/fixcommadelimited
...
Fixes from_one_comma_delimited, no more split at space
2014-12-29 14:42:17 -08:00
Pyfisch
eac6fe7c93
Fixes from_one_comma_delimited, no more split at space
...
Before from_one_comma_delimited split at ",", and " "
this made it unusable for the Accept-* headers since
their fields may contain whitespace.
2014-12-29 21:03:24 +01:00
Pyfisch
5fccdea90d
Fixes #211 and adds one test for it.
2014-12-29 12:15:08 +01:00
Lorenzo Villani
358b3c3a38
Typo: wrapped -> wrapper
2014-12-26 23:21:41 +01:00
Sean McArthur
84b49cb364
other rustup fallout
2014-12-23 14:04:21 -08:00
Sean McArthur
79fc40cbce
into_string to to_string, from_str to parse
2014-12-23 13:09:58 -08:00
Sean McArthur
691c70a380
update str::from_utf8
2014-12-23 12:55:53 -08:00
Aaron Weiss
be6cc34caf
Server programs no longer exit immediately.
2014-12-21 16:23:48 -05:00
Aaron Weiss
f9ed262904
Fixed compilation for Rust master.
2014-12-21 10:25:38 -05:00
Jonathan Reem
06a9ccf978
(fix) Use the clone implementation for &str.
2014-12-20 02:39:29 -08:00
Jonathan Reem
90925f05ee
(fix) Add semicolons at macro invocation sites.
2014-12-20 02:38:03 -08:00
Erik Hedvall
02ecad33cd
Change implementation of AnyRefExt for references to NetworkStream to require 'static lifetime
2014-12-16 00:07:07 +01:00
Erik Hedvall
9896bcc517
proc() -> move ||
2014-12-16 00:02:35 +01:00
Sean McArthur
d19cfed422
Merge pull request #182 from hyperium/client
...
feat(client): add a new Client struct with super powers
2014-12-14 12:02:13 -08:00
Sean McArthur
8c83a3358e
feat(client): add a new Client struct with super powers
...
- Includes ergonomic traits like IntoUrl and IntoBody, allowing easy
usage.
- Client can have a RedirectPolicy.
- Client can have a SslVerifier.
Updated benchmarks for client. (Disabled rust-http client bench since it
hangs.)
2014-12-14 11:56:39 -08:00
Sean McArthur
2d6c8819cd
Merge pull request #193 from wenderen/vary-header
...
add vary header, first draft
2014-12-13 12:31:40 -08:00
Sean McArthur
0bba6e80ee
rust upgrade
2014-12-12 12:24:54 -08:00
Rohan Prinja
258e739ef8
add vary header, first draft
2014-12-12 19:12:55 +05:30
Sean McArthur
5e560cb1c1
Merge pull request #192 from hyperium/ssl-set-hostname
...
fix(ssl): set_hostname on ssl connections
2014-12-11 21:04:21 -08:00
Sean McArthur
3ac277b1f0
fix(ssl): set_hostname on ssl connections
2014-12-11 20:27:37 -08:00
Jonathan Reem
b1ab03f7f8
(fix) Harden header parsing against memory exhaustion attacks.
...
Adds new limits on the lengths of header names and fields.
Fixes #187
2014-12-11 17:08:57 -08:00
Rohan Prinja
4bae6b7e0e
add allow header
2014-12-11 00:18:32 +05:30
Sean McArthur
89bedd30ba
rustup for clone trait
2014-12-09 16:50:49 -08:00
Sean McArthur
514f96e9eb
Merge pull request #180 from wenderen/etag-header
...
add etag header
2014-12-07 23:48:10 -08:00
Rohan Prinja
c4efa80fb5
add etag header
2014-12-08 13:08:53 +05:30
Corey Richardson
6d91693a41
Add missing reexport
2014-12-07 18:51:50 -05:00
Corey Richardson
e2d387d118
header: add If-Modified-Since support
2014-12-07 18:48:05 -05:00
Sean McArthur
debebe8fbe
rustup
2014-12-06 10:52:00 -08:00
Sean McArthur
ae88092587
Merge pull request #168 from hyperium/ssl-verify
...
r=reem
2014-12-04 17:41:42 -08:00
Sean McArthur
36429ab50c
refactor(net): NetworkConnecter no longer is for static usage
...
Instead, you can use an instance of a NetworkConnector with
`Request::with_connector`. This allows overloading of the NetworkStream
constructors, so that it is easy to modify how an `HttpStream` is
created, while still relying on the rest of the stream implementation.
BREAKING CHANGE
2014-12-04 17:39:38 -08:00
Kyle Dewey
4febf65a88
Removed now-deprecated Equiv implementation
2014-12-04 14:10:56 -08:00
Sean McArthur
9a2605a138
Merge pull request #165 from hyperium/expires
...
Adds CacheControl, Expires, and LastModified headers
2014-12-02 21:22:32 -08:00
Sean McArthur
e19330326d
Merge pull request #161 from hyperium/mucell
...
refactor(headers): changed from rwlock to mucell underneath
2014-12-02 21:20:52 -08:00
Stanislav Panferov
6a8864cc27
Add more functions for client to work with cookies. Fixes #155 .
2014-12-03 00:33:25 +03:00