Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-pro committed Aug 7, 2024
1 parent d0777e6 commit a6e9f87
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
25 changes: 16 additions & 9 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
# Changes

## 0.4.0 2024-08-07

- Major: Update Dashmap and Redis dependencies.

## 0.3.1 2024-01-21

- Patch: Fix Redis key expiry bug.

## 0.3.0 2024-01-21

- Breaking: Removes async-trait dependency.
- Breaking: Redis backend now uses BITFIELD to store counts.
- Breaking: Backend return type is now a `Decision` enum instead of a `bool`.
- Major: Removes async-trait dependency.
- Major: Redis backend now uses BITFIELD to store counts.
- Major: Backend return type is now a `Decision` enum instead of a `bool`.

## 0.2.2 2022-04-19

- Improve documentation.
- Patch: Improve documentation.

## 0.2.1 2022-04-18

- Added `SimpleBuilderFuture` type alias.
- Minor: Added `SimpleBuilderFuture` type alias.

## 0.2.0 2022-04-17

- Middleware will now always render a response on error cases, except for an error from the wrapped service call which
is now returned immediately.
- Major: Middleware will now always render a response on error cases, except for an error from the wrapped service call
which is now returned immediately.

## 0.1.1 2022-04-16

- Fixed docs.rs configuration

- Patch: Fixed docs.rs configuration
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "actix-extensible-rate-limit"
version = "0.3.1"
version = "0.4.0"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "Rate limiting middleware for actix-web"
Expand Down
6 changes: 3 additions & 3 deletions src/middleware/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ where
let rollback_condition = self.rollback_condition.clone();

Box::pin(async move {
let input = match (input_fn)(&req).await {
let input = match input_fn(&req).await {
Ok(input) => input,
Err(e) => {
log::error!("Rate limiter input function failed: {e}");
Expand All @@ -143,7 +143,7 @@ where
// Able to successfully query rate limiter backend
Ok((decision, output, rollback)) => {
if decision.is_denied() {
let response: HttpResponse = (denied_response)(&output);
let response: HttpResponse = denied_response(&output);
return Ok(req.into_response(response).map_into_right_body());
}
(Some(output), Some(rollback))
Expand Down Expand Up @@ -179,7 +179,7 @@ where
}

if let Some(transformation) = allowed_transformation {
(transformation)(service_response.headers_mut(), output.as_ref(), rolled_back);
transformation(service_response.headers_mut(), output.as_ref(), rolled_back);
}

Ok(service_response.map_into_left_body())
Expand Down

0 comments on commit a6e9f87

Please sign in to comment.