Commit Graph

44 Commits

Author SHA1 Message Date
Fernando Mendez
318b067a06 feat(headers): Add If-None-Match header field
Add the HTTP/1.1 `If-None-Match` header field makes the request method conditional
on a recipient cache or origin server either not having any current
representation of the target resource, when the field-value is "*",
or having a selected representation with an entity-tag that does not
match any of those listed in the field-value.

Closes #238
2015-02-07 16:52:12 -04:00
Hugo Duncan
b5543b6752 feat(headers): add IfUnmodifiedSince header
This adds support for the If-Unmodified-Since header, and is a trivially
edited version of IfModifiedSince.
2015-02-06 18:42:52 -05:00
Sean McArthur
e5417b834b Merge pull request #271 from pyfisch/cookie
refactor(headers): Rename `Cookies` header to `Cookie`
2015-01-26 10:35:34 -08:00
Pyfisch
92f43cf873 refactor(headers): Rename Cookies header to Cookie
`Cookie` is the actual name of the header and since all other header structs
use the exact camel-cased version of their name using a different name here
is very inconvienient and confusing. You will encounter weird errors if you
try to use `Cookie` as the header. For this reason rename `Cookies` as
discussed on IRC with @seanmonstar and @reem and use `CookiePair` for real
cookies.

BREAKING CHANGE: Change header `Cookie` to `Cookie`
2015-01-26 17:10:36 +01:00
Pyfisch
767c95d2b9 feat(headers): Add Pragma header field
Add the HTTP/1.0 `Pragma` header field used to prevent older Caches, that
do not understand the `Cache-Control` header field from caching the ressource.

Closes #237
2015-01-24 15:09:59 +01:00
Sean McArthur
9e3c94d764 fix(rustup): update to newest fmt trait names and slice syntax 2015-01-23 14:17:19 -08:00
Sean McArthur
8215889eda refactor(headers): remove marker from header_name method
It is no longer required, as we can use `<H as Header>::header_name()`.

BREAKING CHANGE: Implementations of Header will need to adjust the
    header_name method. It no longer takes any arguments.
2015-01-22 15:20:38 -08:00
Jason N
e43c35c1ca fix(headers): make Schemes, Basic, Protocol public
Expose Authorization header Scheme trait and Basic authorization
Expose the Upgrade header Protocol
2015-01-22 14:26:51 +11:00
ProtectedMode
115f56adf9 refactor(headers): make CacheDirective public 2015-01-21 21:43:38 +00:00
Pyfisch
8d0e5bc302 refactor(headers): export all headers and utils directly under header
Currently headers are exported at many places. For example you can access
`Transfer-Encoding` header at `header`, `header::common` and
`header::common::transfer_encoding`. Per discussion on IRC with
@seanmonstar and @reem, all contents of headers will be exposed at `header`
directly. Parsing utilities will be exposed at `header::parsing`. Header
macros can now be used from other crates.

This breaks much code using headers. It should use everything it needs
directly from `header::`, encodings are exposed at `header::Encoding::`,
connection options are exposed at `header::ConnectionOption`.
2015-01-20 13:04:42 +01:00
Sean McArthur
7a5813b4b2 Merge pull request #235 from kstep/referer-header
Add `Referer` header definition
2015-01-19 15:45:18 -08:00
Pyfisch
dfa5e69d7c refactor(headers): add header macros and add two example uses
Add `impl_header!` and `impl_list_header!` macros. Rewrite `Accept-Encoding`
and `Server` header implementations to use the new macros.
2015-01-15 19:26:33 +01:00
Konstantin Stepanov
df857aa3f8 add referer header definition 2015-01-11 02:19:29 +03:00
cyderize
122e94c8a6 Update for latest rust
Tracks rust nightly.

7 tests fail -- still finding source
2015-01-10 18:37:10 +11:00
Pyfisch
c228a5506a Worked on Access-Control-* header family. 2015-01-06 22:04:35 +01:00
Pyfisch
0f781efd7b Merge branch 'master' into accesscontrol 2015-01-06 20:37:23 +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
Pyfisch
76126fc6c7 feat(headers): adds Accept
Moved utils to shared/. Added quality_value.
2015-01-03 11:06:38 -08:00
Jonathan Reem
90925f05ee (fix) Add semicolons at macro invocation sites. 2014-12-20 02:38:03 -08:00
Rohan Prinja
258e739ef8 add vary header, first draft 2014-12-12 19:12:55 +05:30
Rohan Prinja
4bae6b7e0e add allow header 2014-12-11 00:18:32 +05:30
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
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
Sean McArthur
f182f53210 feat(headers): add CacheControl header 2014-12-01 19:58:07 -08:00
Sean McArthur
0297147dd1 feat(headers): add LastModified header 2014-11-30 15:59:40 -08:00
Sean McArthur
e255f88dd2 feat(headers): add Expires header 2014-11-30 15:47:02 -08:00
Sean McArthur
d71d6549f7 refactor(headers): changed from rwlock to mucell underneath 2014-11-29 22:06:48 -08:00
Sean McArthur
8071cfa8bf feat(headers): header ergonomics
- Reexports all common::* as header::*
- Most headers implement Deref where it makes sense.

Closes #156
2014-11-29 13:55:50 -08:00
Sean McArthur
7e55506134 move other header parse utils to util module 2014-11-19 10:08:07 -08:00
Jakob Gillich
125e1f7d63 std::from_str has been moved to std::str 2014-11-17 20:09:53 +01:00
Jonathan Reem
18f5e89432 Add bench_header for benchmarking header implementations. 2014-11-10 16:32:09 -08:00
Sean McArthur
fcfb0505dd update to newest cookie-rs 2014-11-10 12:33:29 -08:00
Sean McArthur
5c224289ec adjustments to Cookie and SetCookie 2014-11-10 12:32:11 -08:00
Stanislav Panferov
a85cc476e1 Basic Cookie and Set-Cookie (only parsing) headers implementation. 2014-11-10 12:31:33 -08:00
Gilman Tolle
91a8e03e7a Implemented a typed Authorization header
An Authorization header contains a Scheme. If you have no real scheme,
you can use String as your scheme (Authorization<String>).

This includes the `Basic` scheme built-in.
2014-10-31 18:51:23 -07:00
Sean McArthur
0ab52c9009 add bits to deal with Upgrade requests 2014-10-27 20:36:57 -07:00
Gilman Tolle
5615ab276e Exposed the 'from_one_raw_str' function for use in defining new header structs. 2014-10-15 23:40:40 -07:00
Stanislav Panferov
10db5ee896 Add Location header 2014-10-05 20:05:27 +04:00
Jonathan Reem
f2c09c5743 Split common headers into a submodule and into their own files
This is a more extensible place to put them and doesn't clutter up
header/mod.rs as much as the old scheme did.

Fixes #8
2014-09-08 16:20:50 -07:00