Commit Graph

174 Commits

Author SHA1 Message Date
daragh f6e3e03eec
fix: clippy warnings and cargo fmt 2024-01-04 20:51:03 +00:00
Josh Triplett 3d504092d2
Merge pull request #904 from mmikulski/831-expose-http_types-method
Fix #831 Expose Method from http_types.
2023-05-21 01:30:40 +02:00
Josh Triplett b5b741f07a
Remove unneeded braces 2023-05-21 01:30:34 +02:00
Josh Triplett e9f47504ff Fix clippy warnings 2023-05-21 01:20:12 +02:00
Maciej Mikulski 8206b63c4c Fix #831 Expose Method from http_types. 2023-04-12 22:28:14 +02:00
Josh Triplett 9f3cde60b1
Merge pull request #812 from murphysean/securesession
Session cookie secure attribute
2022-07-21 11:57:26 -07:00
Josh Triplett 47866dd875
Merge pull request #755 from jbr/remove-logger-from-default-middleware
remove the logger from the default middleware
2022-04-26 20:50:41 -07:00
Sean Murphy 89b20de3b6 Session cookie secure attribute 2022-03-14 21:22:50 -07:00
Jeremiah Senkpiel eb33a63018
Merge pull request #802 from jbr/routefinder
try using routefinder
2021-12-06 12:09:54 -08:00
Yoshua Wuyts 8d017589f2 fix surf 2021-09-06 15:32:04 +02:00
Jacob Rothstein 7ee20de87f
try using routefinder 2021-08-10 12:09:11 -07:00
Jeremiah Senkpiel 88a2aa24b6 fix clippy warning from 1.51
some of these should be actually changed in a PR...
2021-04-21 10:14:56 -07:00
Yoshua Wuyts a3c9ae3e07
Merge pull request #795 from u5surf/issue-777
bugfix : serve_dir doesn't precede to other route
2021-04-02 13:16:37 +02:00
jlkiri e55542a806 SameSite Lax as default
Browser treat SameSite policy as Lax if it is not specified
2021-02-21 17:21:45 +09:00
u5surf 47e0f25703 bugfix : serve_dir doesn't precede to other route 2021-02-08 00:45:37 +09:00
Jacob Rothstein 14a85b3f09
remove the logger from the default middleware 2020-11-30 14:20:01 -08:00
Yoshua Wuyts 5fa1765273 Update log.rs 2020-11-11 21:44:26 +01:00
rhuffus 3fd1770ca9 Add with_cookie_domain method to SessionMiddleware 2020-10-30 11:39:46 +01:00
Jacob Rothstein 4e1152d195
Merge branch 'main' into param-error 2020-10-03 15:31:16 -07:00
Jacob Rothstein 904a45e40e tide::Server implements http_client::HttpClient 2020-10-03 15:26:57 -07:00
Yoshua Wuyts 528fe8cb30
Merge branch 'main' into param-error 2020-10-02 00:15:46 +02:00
Mendelt Siebenga e894754e10 Fix a missing as_ref that caused boxed endpoints to enter an infinite loop
I also added a test for this that shows it now works.
thanks to Hasali19 for noticing this
2020-10-01 21:24:44 +02:00
Yoshua Wuyts a125628bee Remove parsing from `Request::param` 2020-09-27 12:50:28 +02:00
Yoshua Wuyts 1871e60fdd Update to latest Surf alpha in tests 2020-09-27 00:24:51 +02:00
Yoshua Wuyts ed7ea863ea
Merge pull request #662 from jbr/only-log-once
Only run the log middleware once per request
2020-07-31 11:26:21 +02:00
Yoshua Wuyts e3602c2271 cargo fmt 2020-07-30 10:33:16 +02:00
Yoshua Wuyts 915c7f80e8 Rename .middleware to .with 2020-07-30 10:23:47 +02:00
Jacob Rothstein fa7d7fae1d Tide sessions 2020-07-27 16:35:22 -07:00
Jacob Rothstein 530f93117d
Only run the log middleware once per request 2020-07-26 17:16:52 -07:00
Ririsoft ae0e5328ba enable clippy for tests
Clippy is valuable for tests too.
2020-07-21 09:57:10 -07:00
Jeremiah Senkpiel 50bc628a26 Server: require State to be Clone
Alternative to
https://github.com/http-rs/tide/pull/642

This approach is more flexible but requires the user ensure that their
state implements/derives `Clone`, or is wrapped in an `Arc`.

Co-authored-by: Jacob Rothstein <hi@jbr.me>
2020-07-16 11:05:02 -07:00
Jacob Rothstein 43dadc429d prefer http+unix 2020-07-13 16:53:37 -07:00
Jacob Rothstein 164ed84def simplify MultiListeners with FuturesUnordered 2020-07-13 16:53:37 -07:00
Jacob Rothstein b3f086cf8f Introduce ToListener and Listener 2020-07-13 16:53:37 -07:00
Jacob Rothstein 1cb4a82443 use async_trait to simplify async signatures 2020-07-13 15:08:08 -07:00
Vladan Popovic 3778706155 Don't panic on missing path param
Resolves: #324
2020-07-10 18:22:47 -07:00
Jacob Rothstein 8f152aa86f introduce an extension trait for testing servers 2020-07-10 11:11:01 -07:00
Yoshua Wuyts a5b911d05d
Merge pull request #637 from pbzweihander/servedir-404
Make `ServeDir` return 404 if file does not exists
2020-07-10 17:37:19 +02:00
Yoshua Wuyts 5f9c781522
Apply suggestions from code review 2020-07-10 17:20:39 +02:00
Jeremiah Senkpiel 09836ad010
Merge pull request #570 from Fishrock123/new-http-types-errors
Rework middleware to receive Response directly, add optional errors to Response
2020-07-09 10:13:36 -07:00
rusty 3fcefb73df
Add integration test for serve_dir 2020-07-09 16:03:21 +09:00
Yoshua Wuyts 7012e33204 cargo fmt 2020-07-08 19:23:34 +02:00
Yoshua Wuyts 6d9e9053ac Add a log test 2020-07-08 19:03:16 +02:00
Jeremiah Senkpiel 506352ac35 Response: add optional error storage
This allows errors to be propagated through the Tide middleware stack
while still keeping an existing Response intact. Effectively allowing
headers, body, etc to be passed along with an Error; while also opening
up options for nicer error handling via `res.downcast_error<>` checking.

Also contains APIs for turning an Error into a Response via Into, and
taking the error from / setting an error on an existing Response.

This is a breaking change in that `next.run().await` within middleware
no longer returns a tide::Result but rather always returns a
tide::Response.

Thanks to Jacob Rothstein for helping me get this to compile!

PR-URL: #570
2020-07-07 14:57:04 -07:00
Jacob Rothstein f928c013e3 update examples and tests 2020-06-27 14:07:40 -07:00
Jacob Rothstein 6a40a9d136 use route-recognizer 0.2 2020-06-19 11:04:14 -07:00
Jannik Obermann 53cf24b432 Add tests for function middleware 2020-06-17 10:12:54 -07:00
Jacob Rothstein 42a3ba17a7
fix tempfile usage
not sure how this compiled and passed ci without this
2020-06-12 12:33:30 -07:00
Yoshua Wuyts f64858a8c5
Merge branch 'master' into no-unnecessary-move 2020-06-12 16:42:50 +02:00
Yoshua Wuyts 5066c4e3ca Fix CI
tempdir is now broken, use tempfile crate instead
2020-06-12 13:35:30 +02:00