Skip to content
This repository was archived by the owner on Nov 18, 2019. It is now read-only.

Commit c015c95

Browse files
committed
Prepare v0.3.1 for release
1 parent 8176201 commit c015c95

File tree

4 files changed

+26
-13
lines changed

4 files changed

+26
-13
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## Courier v0.3.1 (2017-08-23)
4+
5+
Quick update to the v0.3 release fixing some issues with the initial version.
6+
7+
### Fixes
8+
9+
* Fixed the generated [`Responder`] impl to actually generate MessagePack responses when the
10+
`msgpack` feature is enabled, and to not generate JSON responses when the `json` feature is
11+
disabled. ([#1](https://github.com/excaliburHisSheath/courier/pull/1))
12+
* Fixed the generated [`Responder`] impl to check the [`Accept`] header to determine what format
13+
to use for the response body. ([#1](https://github.com/excaliburHisSheath/courier/pull/1))
14+
315
## Courier v0.3 (2017-08-22)
416

517
Initial release supporting v0.3.x of Rocket. Provides support for deriving [`FromData`] and
@@ -13,3 +25,4 @@ respectively. Also supports using both [JSON] and [MessagePack] formats for data
1325
[MessagePack]: http://msgpack.org/index.html
1426
[`serde::Deserialize`]: https://docs.rs/serde/1/serde/trait.Deserialize.html
1527
[`serde::Serialize`]: https://docs.rs/serde/1/serde/trait.Serialize.html
28+
[`Accept`]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "courier"
3-
version = "0.3.0"
3+
version = "0.3.1"
44
authors = ["David LeGare <excaliburhissheath@gmail.com>"]
55
description = "Utility to make it easier to send and receive data when using the Rocket framework."
66
documentation = "https://docs.rs/courier"

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Add `courier`, as well as the relevant Serde crates to your `Cargo.toml`:
4646

4747
```toml
4848
[dependencies]
49-
courier = "0.3"
49+
courier = "0.3.1"
5050
serde = "1.0"
5151
serde_derive = "1.0"
5252
serde_json = "1.0"
@@ -92,7 +92,7 @@ serde_derive = "1.0"
9292
serde_json = "1.0"
9393

9494
[dependencies.courier]
95-
version = "0.3"
95+
version = "0.3.1"
9696
features = ["msgpack"]
9797
```
9898

@@ -114,17 +114,16 @@ not wish to support JSON, you can specify `default-features = false` in your `Ca
114114

115115
```toml
116116
[dependencies.courier]
117-
version = "0.3"
117+
version = "0.3.1"
118118
default-features = false
119119
features = ["msgpack"]
120120
```
121121

122122
## Using Multiple Formats
123123

124124
When multiple formats are enabled at once, the [`Content-Type`] header in the request is used to
125-
determine which format to use. A response will use the same content type specified in the request,
126-
so a request sent with JSON will receive a response with JSON, a request sent with MessagePack
127-
will get a response with MessagePack, and so on.
125+
determine which format the request data is in, and the [`Accept`] header is used to determine which
126+
format to use for the response.
128127

129128
While this mostly removes the need for [`rocket_contrib::Json`] (and similar types), it is still
130129
possible to use it to override the behavior defined with `courier`. For example, say you
@@ -168,4 +167,5 @@ Note, though, that recommended to not explicitly specify the `format` parameter
168167
[`serde_json`]: https://crates.io/crates/serde_json
169168
[`rmp-serde`]: https://crates.io/crates/rmp-serde
170169
[`Content-Type`]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type
170+
[`Accept`]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept
171171
[`rocket_contrib::Json`]: https://api.rocket.rs/rocket_contrib/struct.Json.html

src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//!
77
//! ```toml
88
//! [dependencies]
9-
//! courier = "0.3"
9+
//! courier = "0.3.1"
1010
//! serde = "1.0"
1111
//! serde_derive = "1.0"
1212
//! serde_json = "1.0"
@@ -76,7 +76,7 @@
7676
//! serde_json = "1.0"
7777
//!
7878
//! [dependencies.courier]
79-
//! version = "0.3"
79+
//! version = "0.3.1"
8080
//! features = ["msgpack"]
8181
//! ```
8282
//!
@@ -99,17 +99,16 @@
9999
//!
100100
//! ```toml
101101
//! [dependencies.courier]
102-
//! version = "0.3"
102+
//! version = "0.3.1"
103103
//! default-features = false
104104
//! features = ["msgpack"]
105105
//! ```
106106
//!
107107
//! ## Using Multiple Formats
108108
//!
109109
//! When multiple formats are enabled at once, the [`Content-Type`] header in the request is used to
110-
//! determine which format to use. A response will use the same content type specified in the request,
111-
//! so a request sent with JSON will receive a response with JSON, a request sent with MessagePack
112-
//! will get a response with MessagePack, and so on.
110+
//! determine which format the request data is in, and the [`Accept`] header is used to determine which
111+
//! format to use for the response.
113112
//!
114113
//! While this mostly removes the need for [`rocket_contrib::Json`] (and similar types), it is still
115114
//! possible to use it to override the behavior defined with `courier`. For example, say you
@@ -186,6 +185,7 @@
186185
//! [`serde_json`]: https://crates.io/crates/serde_json
187186
//! [`rmp-serde`]: https://crates.io/crates/rmp-serde
188187
//! [`Content-Type`]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type
188+
//! [`Accept`]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept
189189
//! [`rocket_contrib::Json`]: https://api.rocket.rs/rocket_contrib/struct.Json.html
190190
191191
#![recursion_limit="128"]

0 commit comments

Comments
 (0)