Sergio Benitez
237c673be4
Rename '#[error]' to '#[catch]', 'errors!' to 'catchers!'.
2017-09-22 19:04:14 -07:00
Sergio Benitez
92ce006e2c
Use the 'response::Result' alias in all 'Responder' impls.
2017-09-21 18:49:28 -07:00
Sergio Benitez
c31ad28efc
Add a 'Responder' impl for 'Vec<u8>'.
2017-09-21 18:48:39 -07:00
Sergio Benitez
96a2f1e4c4
Add a 'Binary' media type for 'application/octet-stream'.
2017-09-21 18:46:48 -07:00
Sergio Benitez
4d9e6afa11
Document case-insensitivity of 'from_ext'.
2017-09-21 18:36:11 -07:00
Sergio Benitez
c36701671b
Use a 'BufReader' for file-based bodies.
2017-09-21 18:35:33 -07:00
Sergio Benitez
63169599a7
Convert several 'compilefail' tests to 'ui' tests.
2017-09-21 18:01:56 -07:00
Sergio Benitez
78cc1bda7e
Upgrade to 'compiletest' 0.3.
2017-09-21 17:17:40 -07:00
Sergio Benitez
f9f4822941
Remove now unneeded 'syntax_pos' import.
2017-09-21 16:57:29 -07:00
Sergio Benitez
32eeae1733
Use 'Uri' instead of 'String' in 'Redirect'.
2017-09-15 04:00:50 -07:00
Sergio Benitez
cced491ec9
Implement 'From<Cow<str>>' for 'Uri'.
2017-09-15 03:22:59 -07:00
Sergio Benitez
23093a33b8
Document 'FromParam' impl for 'Cow<str>'.
2017-09-15 02:47:29 -07:00
Sergio Benitez
16feedd563
Remove 'drop_types_in_const' feature: stabilized.
2017-09-14 22:39:19 -07:00
Sergio Benitez
33e9726151
Use 'decl_macro' in markdown docs.
2017-09-14 22:13:07 -07:00
Sergio Benitez
245f815657
Document 'FromUriParam'.
2017-09-14 22:13:07 -07:00
Sergio Benitez
eeef8a44ce
Document the 'uri!' macro.
2017-09-14 22:13:07 -07:00
Sergio Benitez
17b8ab694c
Use 'FromUriParam' trait for better ergonomics in 'uri!'.
2017-09-14 22:13:07 -07:00
Sergio Benitez
3bf577db6e
Handle segments parameters in 'uri!'.
...
This commit also moves the 'uri' module into its own directory,
includes the beginning of the 'FromUriParam' trait, and abandons the
'url' crate in favor of 'percent_encoding' for percent encoding.
2017-09-14 22:13:07 -07:00
Sergio Benitez
5efc4b1096
Rename 'URI' to 'Uri'.
2017-09-14 22:13:07 -07:00
Sergio Benitez
b033a2e2a9
Document 'UriDisplay' trait.
2017-09-14 22:13:03 -07:00
Sergio Benitez
909eae894a
Don't implement 'UriDisplay' for all 'T: Display'.
...
We don't know if that 'Display' implementation is URI safe, so using
it blindly could result in generating bad URIs.
2017-09-14 22:12:54 -07:00
Sergio Benitez
f623d92484
Implement 'FromParam' for 'Cow<str>'.
2017-09-14 22:12:54 -07:00
Sergio Benitez
24f7734c00
Check mount point validity in 'uri!' macro.
2017-09-14 22:12:54 -07:00
Sergio Benitez
d8acd04789
Fix mountpoint in 'mount_point' test.
2017-09-14 22:12:47 -07:00
Sergio Benitez
bbeb95357b
Add compile-fail tests for 'uri!' macro.
2017-09-14 22:12:47 -07:00
Sergio Benitez
02cff01e17
Give a nice error when uri! macro is empty.
2017-09-14 22:12:46 -07:00
Sergio Benitez
c4524400b2
Add suite of positive tests for typed URIs.
2017-09-14 22:12:46 -07:00
Sergio Benitez
a291c9b42e
Improve 'uri!' macro internal code.
2017-09-14 22:12:03 -07:00
Sergio Benitez
a9dd52a4fb
Ensure mount points are absolute.
2017-09-14 22:12:03 -07:00
Sergio Benitez
96b3d81882
Make all run-pass tests regular tests.
2017-09-14 22:12:03 -07:00
Sergio Benitez
084481a84e
Initial implementation of typed URIs.
...
This is a breaking change. All Rocket applications using code
generation must now additionally declare usage of the 'decl_macro'
feature.
2017-09-14 22:10:25 -07:00
Sergio Benitez
322c02f654
A better, but not yet good enough, 'rustfmt.toml'.
2017-09-09 01:54:54 -07:00
Sergio Benitez
f18fa81a4e
Shorten 'handle' function signature to one line.
2017-09-09 00:54:30 -07:00
Sergio Benitez
8dcbca5cda
Relate a 403 status to authorization, not authentication.
...
Resolves #416 .
2017-09-09 00:34:43 -07:00
Lucas Kolstad
2d72928ba1
Properly handle paths with spaces in shell scripts.
2017-09-07 17:07:31 -07:00
Sergio Benitez
b5c2187249
Use '&*' instead of 'as_ref()' for 'String' to '&str' ref.
2017-09-07 16:55:38 -07:00
David Hotham
bd08d50f59
Remove reliance on 'lookup_host'.
2017-09-07 16:45:06 -07:00
Lukas Kalbertodt
329711db3b
Use 'debug_struct' to improve 'Config' 'Debug' impl.
...
Using the method `debug_struct()` of `fmt::Formatter` takes care of
the exact formatting for us. Additionally, it also handles the
"alternate" form of printing enabled with '#'. In the struct case it
prints the struct on multiple lines instead of just one.
This commit also changes the output slightly. Before, the field
`log_level` was printed with `log: {}`. This commit replaces "log"
with "log_level". Additionally, the value of `environment` is now
printed as a struct field instead of being combined with the struct
name.
2017-09-07 11:18:47 -07:00
Ram
0930304aad
Implement 'From<Status>' for 'Failure'.
...
Resolves #399 .
2017-09-07 11:03:57 -07:00
Joshua Rombauer
e656ec87d7
Clarify 'on_request' Fairing documentation.
2017-09-07 10:52:31 -07:00
QuietMisdreavus
62f96331e2
Indent comments to prevent being commonmark code blocks.
2017-09-07 10:41:35 -07:00
Sergio Benitez
37886ce3a2
Only log nonempty fairing collections.
2017-09-04 20:31:35 -07:00
Sergio Benitez
eb3d3dcfeb
Don't print emojis when colors are disabled.
2017-09-04 20:22:10 -07:00
Sergio Benitez
ae46d27129
Clean-up code style in 'lib/rocket.rs'.
2017-09-04 20:11:10 -07:00
Sergio Benitez
aa9d9ab081
Run 'cargo update' in 'mk-docs.sh' script.
2017-09-04 19:07:39 -07:00
Sergio Benitez
2f84d4b18a
Add 'Config::root_relative()'. Make TLS config paths root-relative.
...
Prior to this commit, relative paths to TLS PEM files were incorrectly
treated as being relative to the CWD as opposed to the Rocket config
file, when present. This commit resolves the issue.
2017-09-04 19:01:26 -07:00
Sergio Benitez
237370533c
Update cert in 'tls' example for new 'rustls'.
...
The latest version of `rustls` acts on the SNI extension to TLS without
the apparent ability to disable the behavior. `rustls` requires that the
server's certificate match the client's requested server. The matching
is done by looking at DNS names in the `subjectAltName` extension and
checking if the requested server name is present. Since the certificate
in the `tls` example did not have the `subjectAltName` extension, this
check always failed, and the TLS connection was aborted. This commit
adds the extension to the certificate with a DNS name of `localhost`,
ensuring that TLS succeeds on `localhost`.
2017-09-01 03:16:36 -07:00
Sergio Benitez
2b3aa01463
Improve I/O and BadType config error messages.
2017-08-31 19:05:35 -07:00
Sergio Benitez
3ed0201c6e
Remove unused 'extern crate's.
2017-08-31 17:03:47 -07:00
Sergio Benitez
7ce250b82f
Update dependencies for ring 0.12.
2017-08-31 16:58:24 -07:00