Commit Graph

376 Commits

Author SHA1 Message Date
Pyfisch
14f46035b7 docs(headers): Update documentation of all remaining headers that use macros 2015-04-28 20:31:30 +02:00
Pyfisch
5a8cd31025 docs(headers): Add more docs to conditional headers 2015-04-28 17:38:46 +02:00
Pyfisch
e993f4b544 refactor(headers): Add tests and docs to CORS headers 2015-04-28 09:39:25 +02:00
Pyfisch
f9d75e4dd3 docs(headers): Add examples to Accept* headers 2015-04-28 09:19:35 +02:00
Pyfisch
093a29bab7 fix(headers): Do not parse empty values in list headers.
In empty list header values ``, or list header values with empty items `foo, , bar`,
the empty value is parsed, if the parser does not reject empty values an item is added
to the resulting header. There can't be empty values. Added a test for it in AcceptEncoding.
2015-04-28 08:57:35 +02:00
Pyfisch
621ef521f6 fix(headers): Fix formatting of 0 qualites and formatting of empty list header fields. 2015-04-28 08:46:26 +02:00
Pyfisch
308880b455 feat(headers): Implement Content-Language header field
Closes #475
2015-04-27 21:50:57 +02:00
Sean McArthur
f7f0361626 Merge pull request #479 from mikedilger/ssl_context
Ssl context
2015-04-27 11:17:08 -07:00
Mike Dilger
3a1a24270d feat(server): allow consumer to supply an SslContext
Closes #471
2015-04-27 08:22:10 +12:00
Mike Dilger
fef04d282f refactor(server): make with_listener a free function
Allow a Server to operate without requiring the entire Server struct
to move into the with_listener function (instead only the handler
function needs to move). This, allows other members to not move, or
move separately, which will be needed for the next commit.  See #471
2015-04-27 08:19:31 +12:00
Mike Dilger
1a076d1bc7 feat(net): add https_using_context for user-supplied SslContext 2015-04-27 08:18:11 +12:00
Pyfisch
a27e6812b9 test(headers): Add tests for single value headers. 2015-04-26 19:16:44 +02:00
Pyfisch
6d34448043 test(headers): Test if formatting gives back the same header 2015-04-26 15:49:34 +02:00
Pyfisch
76a4a01348 test(headers): Add tests for possibly empty list headers. 2015-04-26 14:32:10 +02:00
Pyfisch
18f717fcf1 test(headers): Add tests for headers with "*" value 2015-04-26 14:06:46 +02:00
Pyfisch
efd6c96a3c test(headers): Allow tests inside list header macros, add tests.
Adds test cases from the relevant RFCs for a few headers.
See also: #468, do we want the test cases rendered as examples in the docs?
2015-04-26 12:56:09 +02:00
Sean McArthur
60d92c296a feat(client): remove Clone requirement for NetworkStream in Client 2015-04-23 09:27:41 -07:00
Sean McArthur
e814680b55 Merge pull request #473 from hyperium/docup
Docup
2015-04-22 15:45:09 -07:00
Sean McArthur
48a010ffd7 docs(client): add improved usage examples 2015-04-22 12:28:19 -07:00
Sean McArthur
f9ea2dd594 docs(server): add basic usage example 2015-04-22 12:27:50 -07:00
Sean McArthur
8198f41ec0 docs(lib): add links to main modules 2015-04-22 12:27:33 -07:00
Sean McArthur
e234cbe669 Merge pull request #462 from hyperium/client-ergo
Client ergo
2015-04-21 16:22:22 -07:00
Jonathan Reem
76550fdb20 fix(http): Adjust httparse Request and Response lifetimes. 2015-04-18 20:33:58 -07:00
Jorge Israel Peña
c694b1385b fix(server): JoinHandle type parameter
The new beta adopts the new `JoinHandle` API which has a type parameter.
2015-04-17 14:31:54 -07:00
Sean McArthur
a2aefd9a56 feat(client): accept &String as Body in RequestBuilder
BREAKING CHANGE: This removes the trait `IntoBody`, and instead using
  `Into<Body>`, as it's more idiomatic. This will only have broken code
  that had custom implementations of `IntoBody`, and can be fixed by
  changing them to `Into<Body>`.
2015-04-16 10:25:12 -07:00
Sean McArthur
8bc179fb51 feat(client): accept &String for a Url in RequestBuilder
adds an IntoUrl implementation for &String
2015-04-16 10:10:42 -07:00
Sean McArthur
0fb92ee735 feat(debug): add Debug impls for StatusClass, Server, and Listening 2015-04-16 10:04:51 -07:00
Sean McArthur
4f09b002ff feat(log): clean up logging 2015-04-15 21:08:52 -07:00
Sean McArthur
d9187713b2 fix(server): handle keep-alive closing
Closes #437
2015-04-15 20:12:26 -07:00
Sean McArthur
68d4d63c2a fix(server): join on thread when Listening drops
Closes #447
2015-04-15 16:44:48 -07:00
Jonathan Reem
e864956734 fix(server): Use thread::spawn instead of thread::scoped. 2015-04-15 13:15:05 -07:00
Sean McArthur
55b37f0148 test(beta): enable testing on beta rustc 2015-04-15 11:59:23 -07:00
Brandon Sanderson
7b7f9c257d feat(net): make HttpStream implement Debug 2015-04-09 16:13:29 -07:00
Brandon Sanderson
2f606c88bd feat(http): Implement Debug for HttpReader/Writer.
Also derives it for Responses, since that's easy now.
2015-04-08 18:03:08 -07:00
Huon Wilson
ca2815effd fix(headers): Content-Encoding needs a hyphen. 2015-04-09 10:15:42 +10:00
Sean McArthur
564288e5c6 Merge pull request #428 from hyperium/client-box
feat(client): remove generic parameter for Connector
2015-04-07 18:26:27 -07:00
Sean McArthur
499a2c8610 Merge pull request #440 from pyfisch/refactorheaders5
refactor(headers): Use header!() for CORS headers.
2015-04-07 12:51:19 -07:00
Sean McArthur
56d72b4351 Merge pull request #439 from pyfisch/refactorheaders4
refactor(headers): Use header!() macro for Upgrade header field
2015-04-07 12:02:39 -07:00
Pyfisch
94f38950dd refactor(headers): Use header!() for CORS headers.
This is the last bunch of headers that should use the new macro. Moved them out of
their own folder so that the macro works. Changed them, so that they are more in
line with the other headers.

BREAKING CHANGE: `AccessControlAllowHeaders` and `AccessControlRequestHeaders` values
are case insensitive now. `AccessControlAllowOrigin` variants are now `Any` and
`Value` to match the other headers.
2015-04-07 11:54:01 +02:00
Pyfisch
831daafb8c style(headers): Remove commented out code in headers. 2015-04-07 11:08:42 +02:00
Pyfisch
f3508d9204 refactor(headers): Use header!() macro for Upgrade header field 2015-04-07 11:07:26 +02:00
Sean McArthur
ed1ccc6ad3 Merge pull request #420 from pyfisch/refactorheaders2
refactor(headers): Use header!() macro for `ETag` header
2015-04-06 13:39:22 -07:00
Pyfisch
38d297b16e refactor(headers): Use header!() macro for 3 headers with a "*" value
`If-Match`, `If-None-Match` and `Vary` headers are either a "*" value meaning that the header
matches every possible item or a list of items, one of them must be matched to fulfil the condition.

BREAKING CHANGE: `If-Match`, `If-None-Match` and `Vary` item variant name changed to `Items`
2015-04-06 20:41:41 +02:00
Pyfisch
4434ea6a7d refactor(headers): Use header!() macro for ETag header
Change `Etag` (only the `E` is capitalized) to `ETag` as it is written
in the relevant RFC.

BREAKING CHANGE: `Etag` header field is now `ETag` header field
2015-04-06 20:41:00 +02:00
Markus Kobler
660a362b68 chore(net): Upgrading to latest rust openssl 0.6.0 2015-04-06 16:18:52 +01:00
Sean McArthur
139a51f1c3 feat(client): remove generic parameter for Connector
Closes #379

BREAKING CHANGE: For people using the default HttpConnector and Client,
    everything should continue to just work. If the Client has been
    used with a generic parameter, it should be removed.

    However, there were some breaking changes to the internals of
    NetworkConnectors. Specifically, they no longer return a
    NetworkStream, but instead a Into<Box<NetworkStream + Send>>. All
    implementations of NetworkStream should continue to just work,
    however.

    Possible breakages could come from the stricter usage of Send
    throughout the Client API.
2015-04-03 18:36:13 -07:00
Jonathan Reem
8e0655637e fix(headers): Add CowStr as a temporary hack to build on beta.
We can revert this PR when rust-lang/rust#23995 lands, but it won't
land until after beta is cut.
2015-04-02 22:33:55 -07:00
Sean McArthur
0a1916dc64 refactor(auth): adjust Scheme::scheme function to not take a marker Option 2015-04-02 17:38:40 -07:00
Sean McArthur
5c2de29a81 chore(stability): remove core feature gate 2015-04-02 17:32:04 -07:00
Jonathan Reem
320d10d50d chore(all): Move downcasting to a stable implementation. 2015-04-02 13:30:41 -07:00