1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-24 16:02:59 +01:00
Commit Graph

100 Commits

Author SHA1 Message Date
Nikolay Kim
b8b90d9ec9 rename ResourceHandler to Resource 2018-07-12 15:30:01 +06:00
Nikolay Kim
6fd686ef98 cleanup warnings 2018-07-04 21:01:27 +06:00
Nikolay Kim
fec6047ddc refactor HttpRequest mutability 2018-07-02 23:35:32 +06:00
Nikolay Kim
4fadff63f4 Use Box::leak for dynamic param names 2018-06-23 09:57:03 +06:00
Nikolay Kim
765c38e7b9 remove libc dependency 2018-06-22 11:47:33 +06:00
Nikolay Kim
65ca563579 use read only self for Middleware 2018-06-21 23:06:23 +06:00
Nikolay Kim
0f2aac1a27 remove unneed Send and Sync 2018-06-17 08:32:22 +06:00
Nikolay Kim
8261cf437d update actix api 2018-06-13 23:37:19 -07:00
Nikolay Kim
f94fd9ebee CORS: Do not validate Origin header on non-OPTION requests #271 2018-06-05 07:39:47 -07:00
Nikolay Kim
984791187a Middleware::response is not invoked if error result was returned by another Middleware::start #255 2018-06-04 13:42:47 -07:00
Matthijs Brobbel
268c5d9238
Fix typo 2018-06-03 20:28:08 +02:00
Nikolay Kim
a61a1b0efe
Merge branch 'master' into trait-middleware-mut-self 2018-06-02 08:54:00 -07:00
Pascal Hertleif
890a7e70d6 Add missing API docs
These were written without much knowledge of the actix-web internals!
Please review carefully!
2018-06-02 15:52:50 +02:00
Josh Leeb-du Toit
9c9eb62031 Update Middleware trait to use &mut self 2018-06-02 16:47:18 +10:00
Nikolay Kim
c8930b7b6b fix rustfmt formatting 2018-06-01 10:27:23 -07:00
Nikolay Kim
3f5a39a5b7 cargo fmt 2018-06-01 09:37:14 -07:00
Nikolay Kim
154cd3c5de better actix mod re-exports 2018-06-01 09:36:16 -07:00
Douman
80965d7a9a
Re-export actix dependency. Closes #260 (#264)
- Re-export actix's prelude into actix namespace
- Removing implicit dependency on root's actix module
2018-05-31 20:43:14 +03:00
Nikolay Kim
ecd05662c0 use new actix system api 2018-05-29 10:31:37 -07:00
Bruno Bigras
4dcecd907b Add same-site to CookieSessionBackend
closes #247
2018-05-25 19:18:16 -04:00
Nikolay Kim
45e9aaa462 rustfmt 0.7 2018-05-17 12:20:20 -07:00
Nikolay Kim
8de1f60347 add session extractor doc api 2018-05-16 21:05:59 -07:00
Nikolay Kim
b4252f8fd1 implement extractor for Session 2018-05-16 21:02:51 -07:00
Nikolay Kim
54c33a7aff Allow to exclude certain endpoints from logging #211 2018-05-08 16:30:34 -07:00
Alexander Andreev
cd11293c1f spelling check 2018-05-06 19:07:30 +03:00
Nikolay Kim
58079b5bbe add session test 2018-05-02 19:11:44 -07:00
Nikolay Kim
32a2866449 Allow to override files listing renderer for #203 2018-05-02 15:53:07 -07:00
Nikolay Kim
9b6343d54b refactor session impl 2018-05-01 09:40:23 -07:00
Nikolay Kim
d9a4fadaae make HttpRequest::extensions() readonly 2018-05-01 09:05:50 -07:00
Nikolay Kim
eefbe19651 remove deprecated types and methods 2018-04-29 21:05:10 -07:00
Nikolay Kim
c72d1381a6 clippy warnings 2018-04-29 09:09:08 -07:00
Nikolay Kim
de49796fd1 clippy warnings; fmt 2018-04-28 22:55:47 -07:00
Brandur
59244b203c Let CSRF's allowed_origin() be specified as a type supporting Into<String>
A very minor addition: I'm using this middleware on specific resources,
and given a non-static string, I often have to `clone()` already to get
a string into a closure. Take this code for example:

``` rust
let server = actix_web::server::new(move || {
    let csrf_origin_graphql = csrf_origin.clone();

    ...

    .resource("/graphql", move |r| {
	r.middleware(
	    csrf::CsrfFilter::new().allowed_origin(csrf_origin_graphql.as_str()),
	);

	r.method(Method::POST).a(graphql::handlers::graphql_post);
    })
```

Letting `allowed_origin()` take an `Into<String>` instead of `&str` would
prevent a second `clone()` in the code above, and also make the code a little
nicer to read (you eliminate the `.as_str()` above). This is a pattern that
seems to be common throughout actix-web already anyway, so it should also be
fine to have here.
2018-04-21 08:41:06 -07:00
Nikolay Kim
813d1d6e66 doc strings layout 2018-04-18 20:41:03 -07:00
Nikolay Kim
48b02abee7 fmt 2018-04-18 20:16:29 -07:00
Nikolay Kim
ce1081432b export session module 2018-04-18 20:11:49 -07:00
Nikolay Kim
e9bdba57a0 Add identity service middleware 2018-04-18 19:05:24 -07:00
Nikolay Kim
113f5ad1a8 add rustfmt config 2018-04-13 16:02:01 -07:00
Nikolay Kim
23eea54776 update cors doc string 2018-04-09 21:39:32 -07:00
Nikolay Kim
2881859400 proper test for CorsBuilder::resource 2018-04-09 21:29:57 -07:00
Nikolay Kim
1686682c19 extend CorsBuilder api to make it more user friendly 2018-04-09 21:11:15 -07:00
Nikolay Kim
be358db422 CorsBuilder::finish() panics on any configuration error 2018-04-09 14:20:12 -07:00
Nikolay Kim
7df2d6b12a clippy warnings; extend url_for example in user guide 2018-04-09 13:30:38 -07:00
Nikolay Kim
0b0bbd6bd9
Merge branch 'master' into private-cookies 2018-04-09 12:54:08 -07:00
Nikolay Kim
5617896780 cleanup doc tests 2018-04-09 10:40:12 -07:00
Alex Whitney
2b803f30c9 remove CookieSessionBackend::new 2018-04-09 18:33:29 +01:00
Alex Whitney
9b152acc32 add signed and private cookies 2018-04-09 17:59:28 +01:00
Nikolay Kim
eb66685d1a simplify csrf middleware 2018-04-09 09:49:07 -07:00
Nikolay Kim
b505e682d4 fix session doc test 2018-04-09 09:31:11 -07:00
Nikolay Kim
ff14633b3d simplify CookieSessionBackend; expose max_age cookie setting 2018-04-08 11:05:37 -07:00