Commit Graph

452 Commits

Author SHA1 Message Date
Sergio Benitez
b892236ea5 Add 'Config::active()' method. 2018-02-20 03:27:18 -08:00
Sergio Benitez
91edab51f8 Spiffy up 'uncased_eq' implementation. 2018-02-19 02:55:56 -08:00
Sergio Benitez
c620411d92 Add 'keep_alive' configuration parameter.
The 'keep_alive' configuration parameter allows HTTP keep-alive timeouts
to be configured or for keep-alive to be disabled entirely.
2018-02-17 04:06:05 -08:00
Sergio Benitez
c6841ba67a Remove use of unsafe in logger.rs. 2018-02-17 02:12:59 -08:00
Sergio Benitez
de8e1978c5 Remove unsafe 'from_utf8_unchecked'; improve form parsing.
The 'FormItems' iterator now successfully parses empty keys and values
as well as keys without values.
2018-02-14 14:05:26 -08:00
Sergio Benitez
8b1aaed0ce Enforce trailing commas in 'known' macros. 2018-01-30 12:30:31 -08:00
Sergio Benitez
6de76c51bc Only pop a log level if one was previously pushed. 2018-01-29 13:25:33 -08:00
Sergio Benitez
3a8d0e8a9a Dynamically increase/decrease log level at launch.
This commit modifies the internal logger so that launch messages are
emitted with the proper "info" level. The approach is to temporarily
weaken the log level to "normal" during launch and reset it to the
user's setting after launching.

This commit also upgrades to 'log' 0.4.

Fixes #553.
2018-01-29 13:16:04 -08:00
Sergio Benitez
5a9d857329 Account for default config changes in config tests. 2018-01-20 11:36:35 -08:00
Sergio Benitez
2d7b4b4233 Print config info in all environments. 2018-01-20 10:55:01 -08:00
Sergio Benitez
f9a950d1c7 Default to production environment on non-debug builds. 2018-01-20 09:58:52 -08:00
Donald Robertson
19f59b1f9b Use port 8000 as default for all environments.
Closes #317.
2018-01-20 09:43:19 -08:00
Pyry Kontio
b0c1a0a07f Add default catcher for '504: Gateway Timeout'. 2018-01-19 11:44:00 -08:00
Sergio Benitez
5240f860cb Remove superfluous logic in 'Rocket.write_response()'. 2018-01-19 11:23:13 -08:00
Sergio Benitez
d2727972fd Always strip bodies on 'HEAD' requests.
Closes #544.
Closes #514.
2018-01-19 11:21:56 -08:00
Sergio Benitez
72d2ccc2a5 Don't preallocate in 'Body.into_bytes()'. 2018-01-19 11:20:06 -08:00
Sergio Benitez
1ba71cdb25 Group 'Rocket.state()' method with other accessors. 2018-01-12 20:15:55 -08:00
Sergio Benitez
11b769438c Fix incorrect handling of nested 'attach' calls. 2018-01-12 08:34:53 -08:00
Zachary Golba
9bf33bdd1b Add 'application/vnd.api+json' as known media type. 2018-01-05 19:45:08 -08:00
Stanislav Ivanov
70413b155f Add 'LocalRequest::private_cookie()'.
Resolves #368.
2017-12-29 09:16:08 -08:00
Sergio Benitez
dd07c367d5 Add 'Request::client_ip()' method. 2017-12-29 00:40:09 -08:00
Alexander Mielczarek
c2899b2391 Don't rewrite request remote. Add 'Request::real_ip()'.
Resolves #479.
2017-12-28 23:51:14 -08:00
Jeb Rosen
80e7339ebe Add 'Rocket::state()' for managed state retrieval. 2017-12-28 19:57:05 -08:00
Max Furman
4be75accf7 Respond to invalid requests with '400 Bad Request'.
Resolves #465.
2017-12-27 23:10:28 -08:00
Sergio Benitez
804d2b6603 Add a note to disambiguate '{content,contrib}::Json'. 2017-12-26 20:28:53 -08:00
Sergio Benitez
81bae5246b Rename 'state' to 'managed' in 'Request' for clarity. 2017-12-26 20:27:47 -08:00
Sergio Benitez
1ae1bfc101 Add 'success_or' methods to 'Outcome'. 2017-12-23 20:23:03 -08:00
Sergio Benitez
78b10f9bfa Clarify that 'Err' response is not a 'Responder'. 2017-12-21 21:53:13 -08:00
Sergio Benitez
ed0ed2a396 Defer NamedFile's Responder impl to File. 2017-12-21 21:51:36 -08:00
Sergio Benitez
5922eb50b4 Use '#[repr(C)]' on 'str' wrappers to guarantee correct layout.
Closes #494.
2017-12-14 18:10:24 +07:00
Wilson Birney
4749b541a9 Emit sized body when file length is known in 'NamedFile'. 2017-11-29 23:47:53 -08:00
Sergio Benitez
aad97e6be0 Use correct rustdoc 'html_root_url'.
Fixes #474.
2017-11-22 10:58:20 -08:00
Tobias Stolzmann
309ae6348c Fix typo in 'Outcome' docs: 'users' -> 'Users'. 2017-11-17 12:39:36 -08:00
Lukas Kalbertodt
a8e9362b38 Remove incorrect statement in 'RawStr' docs. 2017-11-17 12:36:03 -08:00
Ian Létourneau
7ae9bb678c Add a 'status::BadRequest' responder. 2017-11-17 12:34:38 -08:00
Sergio Benitez
1d53fee0d3 Remove use of now unneeded 'AsciiExt' trait. 2017-11-09 10:10:14 +01:00
Sergio Benitez
a90d625abe Set safer defaults for private cookies. 2017-10-05 21:58:27 -07:00
Sergio Benitez
8de1e32130 Add 'Config::get_string' to retrieve 'String' from extras. 2017-10-05 15:46:40 -07:00
Sergio Benitez
a60c9e812e Move handler definitions to top of file. 2017-09-24 20:19:31 -07:00
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
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
245f815657 Document 'FromUriParam'. 2017-09-14 22:13:07 -07:00