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

3339 Commits

Author SHA1 Message Date
Yuki Okushi
d8f3f94ece Clean up metadata 2020-01-30 18:08:20 +09:00
Yuki Okushi
a0337d7851 Run CI with MSRV 2020-01-30 18:03:02 +09:00
Yuki Okushi
c4c0680a6e Remove unused config 2020-01-30 15:57:38 +09:00
Yuki Okushi
91f6519177 Set up GitHub Actions 2020-01-30 15:57:38 +09:00
Rob Ede
8ab2229032
add new crates to workspace 2020-01-30 02:06:00 +00:00
Rob Ede
90e00f7344
fix badge links 2020-01-30 01:50:18 +00:00
Rob Ede
cfb436a363
unify {cors,identity,session} readmes 2020-01-30 01:42:01 +00:00
Rob Ede
13a42f7262
Merge branch 'web' 2020-01-30 01:31:22 +00:00
Rob Ede
4b3500790d
remove non-extra packages 2020-01-30 01:30:52 +00:00
Rob Ede
3cdc0b9d18
fix badges 2020-01-30 01:22:11 +00:00
Rob Ede
aac1158304
merge project metadata 2020-01-30 00:31:25 +00:00
Aaron Hill
276a5a3ee4
Replace UnsafeCell with Cell in DateServiceInner (#1325)
* Replace `UnsafeCell` with `Cell` in `DateServiceInner`

This ensures that it's impossible to cause undefined behavior by
accidentally violating Rust's aliasing rules (e.g. passing a closure to
`set_date` which ends up invoking `reset` or `update` on the inner
`DateServiceInner`).

There might be a tiny amount of overhead from copying the `Option<(Date,
Instant)>` rather than taking a reference, but it shouldn't be
measurable.

Since the wrapped type is `Copy`, a `Cell` can be used, avoiding the
runtime overhead of a `RefCell`.

Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
2020-01-29 21:05:08 +09:00
Rob Ede
e05b153039
Merge branch 'redis' 2020-01-29 12:02:32 +00:00
Rob Ede
849a85fba8
Merge branch 'proto' 2020-01-29 12:02:28 +00:00
Rob Ede
e1f99b0b9a
Merge branch 'httpauth' 2020-01-29 12:02:17 +00:00
Rob Ede
022f329b4f initial commit 2020-01-29 11:44:22 +00:00
Rob Ede
b4267818de move files into module 2020-01-29 11:42:35 +00:00
Rob Ede
dbd52a48a4 move to own module 2020-01-29 11:42:13 +00:00
Rob Ede
2c216e471e move redis to own module 2020-01-29 11:41:40 +00:00
Andrey Kutejko
664f9a8b2d
Long lasting auto-prolonged session (#1292)
Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
2020-01-29 10:26:39 +09:00
Yuki Okushi
c73c2dc12c
Don't use cache in Windows CI (#1327) 2020-01-29 09:00:04 +09:00
kevinpoitra
e634e64847 Upgrade time to 0.2.5 (#1254)
* Use `OffsetDateTime` instead of `PrimitiveDateTime`

* Parse time strings with `PrimitiveDateTime::parse` instead of `OffsetDateTime::parse`

* Remove unused `time` dependency from actix-multipart

* Fix a few errors with time related tests from the `time` upgrade

* Implement logic to convert a RFC 850 two-digit year into a full length year, and organize time parsing related functions

* Upgrade `time` to 0.2.2

* Correctly parse C's asctime time format using time 0.2's new format patterns

* Update CHANGES.md

* Use `time` without any of its deprecated functions

* Enforce a UTC time offset when converting an `OffsetDateTime` into a Header value

* Use the more readable version of `Duration::seconds(0)`, `Duration::zero()`

* Remove unneeded conversion of time::Duration to std::time::Duration

* Use `OffsetDateTime::as_seconds_f64` instead of manually calculating the amount of seconds from nanoseconds

* Replace a few additional instances of `Duration::seconds(0)` with `Duration::zero()`

* Truncate any nanoseconds from a supplied `Duration` within `Cookie::set_max_age` to ensure two Cookies with the same amount whole seconds equate to one another

* Fix the actix-http:🍪:do_not_panic_on_large_max_ages test

* Convert `Cookie::max_age` and `Cookie::expires` examples to `time` 0.2

Mainly minor  changes. Type inference can be used alongside the new
`time::parse` method, such that the type doesn't need to be specified.
This will be useful if a refactoring takes place that changes the type.
There are also new macros, which are used where possible.

One change that is not immediately obvious, in `HttpDate`, there was an
unnecessary conditional. As the time crate allows for negative durations
(and can perform arithmetic with such), the if/else can be removed
entirely.

Time v0.2.3 also has some bug fixes, which is why I am not using a more
general v0.2 in Cargo.toml.

v0.2.3 has been yanked, as it was backwards imcompatible. This version
reverts the breaking change, while still supporting rustc back to
1.34.0.

* Add missing `time::offset` macro import

* Fix type confusion when using `time::parse` followed by `using_offset`

* Update `time` to 0.2.5

* Update CHANGES.md

Co-authored-by: Jacob Pratt <the.z.cuber@gmail.com>
2020-01-28 20:44:22 +09:00
Kai Ren
cdba30d45f Skip empty chucks for BodyStream and SizedStream (#1308)
* Skip empty chucks for BodyStream and SizedStream when streaming response (#1267)

* Fix tests to fail on previous implementation

Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
2020-01-28 18:28:09 +09:00
Aaron Hill
74dcc7366d Remove several uses of Pin::new_unchecked (#1294)
Most of the relevant struct already had a `#[pin_project]` attribute,
but it wasn't being used.

The remaining uses of `Pin::new_unchecked` all involve going from a
`&mut T` to a `Pin<&mut T>`, without directly observing a `Pin<&mut T>`
first. As such, they cannot be replaced by `pin_project`

Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
2020-01-28 12:35:51 +09:00
Aaron Hill
d137a8635b Replace Pin::new_unchecked with #[pin_project] in tuple_from_req! (#1293)
Using some module trickery, we can generate a tuple struct for each
invocation of the macro. This allows us to use `pin_project` to project
through to the tuple fields, removing the need to use
`Pin::new_unchecked`

Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
2020-01-28 10:45:25 +09:00
Yuki Okushi
a2d4ff157e
Update call_service documentation (#1302)
Co-authored-by: Christian Battaglia <christian.d.battaglia@gmail.com>
2020-01-28 08:09:46 +09:00
Andrey Torsunov
71d11644a7 Add ability to name a handler function as 'config' (#1290)
* eliminate handler naming restrictions #1277

* Update actix-web-codegen/CHANGES.md

Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
2020-01-26 07:22:40 +09:00
Maxim Vorobjov
8888520d83 Add benchmark for full stack request lifecycle (#1298)
* add benchmark for full stack request lifecycle

* add direct service benchmarks

* fix newline

* add cloneable service benchmarks

* remove cloneable bench experiments + cargo fmt

Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
2020-01-25 08:05:25 +09:00
Yuki Okushi
3ed6519c0c
Update changelog (#13) 2020-01-25 02:45:24 +09:00
Yuki Okushi
71e2f682e2
Update example (#12)
* Update example

* Check example's build on CI

* Update README
2020-01-25 02:39:32 +09:00
Yuki Okushi
cf3577550c
Tweak caches (#1319)
* Try to use `cargo-cache`

* Tweak issue template
2020-01-25 02:27:13 +09:00
Yuki Okushi
777990d575
Update dependencies and bump up version to 0.5 (#11)
* Bump up bytes to 0.5

* Update example's dependencies

* Bump up version to 0.5
2020-01-24 15:41:57 +09:00
Maxim Vorobjov
58844874a0 Fixing #1295 convert UnsafeCell to RefCell in CloneableService (#1303)
Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
2020-01-24 14:51:38 +09:00
cetra3
78f24dda03 Initial Issue template (#1311)
* Initial Issue template

* First round of changes for the bug report

Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
2020-01-24 07:32:34 +09:00
godofdream
e17b3accb9 Remove codecoverage for tests and examples (#1299)
* Ignore Tests & Examples for CodeCoverage

Ignore Tests & Examples for CodeCoverage
2020-01-24 05:10:02 +09:00
Yuki Okushi
c6fa007e72
Fix vcpkg cache (#1312) 2020-01-23 11:27:34 +09:00
Rob Ede
a3287948d1 allow explicit SameSite=None cookies (#1282)
fixes #1035
2020-01-23 10:08:23 +09:00
Yuki Okushi
2e9ab0625e
Tweak actions (#1305)
* Add benchmark action

* Fix Windows build
2020-01-23 06:23:53 +09:00
Yuki Okushi
3a5b62b550
Add dependencies instruction (#1281) 2020-01-16 23:17:17 +09:00
Adam Kewley
412e54ce10 Fixed documentation typo for actix-files (#1278) 2020-01-15 11:09:58 -08:00
Parker Timmerman
fe2cc9bf4a Bump up prost to 0.6.0 (#10) 2020-01-16 01:48:33 +09:00
Yuki Okushi
c4b3ef64c2
Prepare release for 0.4.0 (#21)
* Prepare release for 0.4.0

* Update CHANGELOG.md
2020-01-15 00:03:23 +09:00
Yuki Okushi
8dd2c77165
Make the lint stricter (#20)
* Make the lint stricter

* Add explicit lifetimes

* Allow `needless_doctest_main`
2020-01-14 13:31:20 +09:00
Yuki Okushi
d757f44557
Remove description() (#19)
* Remove `description()`

It has been deprecated.
2020-01-11 22:12:11 +09:00
Peter Hall
bca41f8d40 Changes to Cors builder (#1266)
Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
2020-01-11 04:53:17 +09:00
Jacob Brown
7c974ee668 Update doc comment for HttpRequest::app_data (#1265)
* update doc comment for `HttpRequest::app_data`

* add `no_run` to doc comment

* add `ignore` to doc comment

* Update src/request.rs

Co-Authored-By: Yuki Okushi <huyuumi.dev@gmail.com>

Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
2020-01-11 03:55:20 +09:00
linkmauve
abb462ef85 Replace sha1 dependency with sha-1 (#1258)
* Replace sha1 dependency with sha-1

This other crate is being maintained, and it offers better performances
when using the `asm` feature (especially [on
AArch64](https://github.com/RustCrypto/hashes/pull/97)).

* Update CHANGES.md with the sha-1 migration

* Add a test for hash_key()
2020-01-11 02:34:31 +09:00
Nikolay Kim
e66312b664 add extra constraints 2020-01-10 11:36:59 +06:00
Nikolay Kim
39f4b2b39e Merge branch 'master' of github.com:actix/actix-web 2020-01-10 11:28:58 +06:00
Nikolay Kim
f6ff056b8a Fix panic with already borrowed: BorrowMutError #1263 2020-01-10 11:26:54 +06:00