- Update
actix-tlsto3.0.0-rc.1. #2474
- Compress middleware's response type is now
AnyBody<Encoder<B>>. #2448
- Relax
Unpinbound onS(stream) parameter ofHttpResponseBuilder::streaming. #2448
dev::ResponseBodyre-export; is function is replaced by the newdev::AnyBodyenum. #2446
- Re-export
dev::ServerHandlefromactix-server. #2442
ContentType::htmlnow producestext/html; charset=utf-8instead oftext/html. #2423- Update
actix-serverto2.0.0-beta.9. #2442
- Option to allow
Jsonextractor to work without aContent-Typeheader present. #2362 #[actix_web::test]macro for setting up tests with a runtime. #2409
- Associated type
FromRequest::Configwas removed. #2233 - Inner field made private on
web::Payload. #2384 Data::into_innerandData::get_refno longer requiresT: Sized. #2403- Updated rustls to v0.20. #2414
- Minimum supported Rust version (MSRV) is now 1.52.
- Useless
ServiceResponse::checked_exprmethod. #2401
- Re-export actix-service
ServiceFactoryindevmodule. #2325
- Compress middleware will return 406 Not Acceptable when no content encoding is acceptable to the client. #2344
- Move
BaseHttpResponsetodev::Response. #2379 - Enable
TestRequest::paramto accept more than just static strings. #2172 - Minimum supported Rust version (MSRV) is now 1.51.
- Fix quality parse error in Accept-Encoding header. #2344
- Re-export correct type at
web::HttpResponse. #2379
- Add
ServiceRequest::parts_mut. #2177 - Add extractors for
UriandMethod. #2263 - Add extractors for
ConnectionInfoandPeerAddr. #2263 - Add
Route::servicefor using hand-written services as handlers. #2262
- Change compression algorithm features flags. #2250
- Deprecate
App::dataandApp::data_factory. #2271 - Smarter extraction of
ConnectionInfoparts. #2282
- Scope and Resource middleware can access data items set on their own layer. #2288
HttpServer::worker_max_blocking_threadsfor setting block thread pool. #2200
- Adjusted default JSON payload limit to 2MB (from 32kb) and included size and limits in the
JsonPayloadError::Overflowerror variant. [#2162] [#2162]: (actix#2162) ServiceResponse::error_responsenow uses body type ofBody. #2201ServiceResponse::checked_exprnow returns aResult. #2201- Update
language-tagsto0.3. ServiceResponse::take_body. #2201ServiceResponse::map_bodyclosure receives and returnsBinstead ofResponseBody<B>types. #2201- All error trait bounds in server service builders have changed from
Into<Error>toInto<Response<AnyBody>>. #2253 - All error trait bounds in message body and stream impls changed from
Into<Error>toInto<Box<dyn std::error::Error>>. #2253 HttpServer::{listen_rustls(), bind_rustls()}now honor the ALPN protocols in the configuation parameter. [#2226]middleware::normalizenow will not try to normalize URIs with no valid path #2246
HttpResponse::take_bodyand oldHttpResponse::into_bodymethod that casted body type. #2201
HttpResponseandHttpResponseBuilderstructs. #2065
- Most error types are now marked
#[non_exhaustive]. #2148 - Methods on
ContentDispositionthat tookT: AsRef<str>now takeimpl AsRef<str>.
Headerextractor for extracting common HTTP headers in handlers. #2094- Added
TestServer::client_headersmethod. #2097
- Double ampersand in Logger format is escaped correctly. #2067
CustomResponderwould return error asHttpResponsewhenCustomResponder::with_headerfailed instead of skipping. (Only the first error is kept when multiple error occur) #2093
- The
clientmod was removed. Clients should now useawcdirectly. 871ca5e4 - Integration testing was moved to new
actix-testcrate. Namely these items from thetestmodule:TestServer,TestServerConfig,start,start_with, andunused_addr. #2112
- Feature
cookiesis now optional and enabled by default. #1981 JsonBody::newreturns a default limit of 32kB to be consistent withJsonConfigand the default behaviour of theweb::Json<T>extractor. #2010
- Update
actix-web-codegento0.5.0-beta.1.
- The method
Either<web::Json<T>, web::Form<T>>::into_inner()which returns the inner type for whichever variant was created. Also works forEither<web::Form<T>, web::Json<T>>. #1894 - Add
services!macro for helping register multiple services toApp. #1933 - Enable registering a vec of services of the same type to
App#1933
- Rework
Respondertrait to be sync and returnsResponse/HttpResponsedirectly. Making it simpler and more performant. #1891 ServiceRequest::into_partsandServiceRequest::from_partscan no longer fail. #1893ServiceRequest::from_requestcan no longer fail. #1893- Our
Eithertype now usesLeft/Rightvariants (instead ofA/B) #1894 test::{call_service, read_response, read_response_json, send_request}take&Servicein argument #1905App::wrap_fn,Resource::wrap_fnandScope::wrap_fnprovide&Servicein closure argument. #1905web::blockno longer requires the output is a Result. #1957
- Multiple calls to
App::datawith the same type now keeps the latest call's data. #1906
- Public field of
web::Pathhas been made private. #1894 - Public field of
web::Queryhas been made private. #1894 TestRequest::with_header; useTestRequest::default().insert_header(). #1869AppService::set_service_data; for custom HTTP service factories adding application data, use the layered data model by callingServiceRequest::add_data_containerwhen handling requests instead. #1906
Compatmiddleware enabling generic response body/error type of middlewares likeLoggerandCompressto be used inmiddleware::ConditionandResource,Scopeservices. #1865
- Update
actix-*dependencies to tokio1.0based versions. #1813 - Bumped
randto0.8. - Update
rust-tlsto0.19. #1813 - Rename
HandlertoHandlerServiceand renameFactorytoHandler. #1852 - The default
TrailingSlashis nowTrim, in line with existing documentation. See migration guide for implications. #1875 - Rename
DefaultHeaders::{content_type => add_content_type}. #1875 - MSRV is now 1.46.0.
- Added the underlying parse error to
test::read_body_json's panic message. #1812
- Public modules
middleware::{normalize, err_handlers}. All necessary middleware structs are now exposed directly by themiddlewaremodule. - Remove
actix-threadpoolas dependency.actix_threadpool::BlockingErrorerror type can be imported fromactix_web::errormodule. #1878
- Removed an occasional
unwraponNonepanic inNormalizePathNormalization. #1762 - Fix
match_pattern()returningNonefor scope with empty path resource. #1798 - Increase minimum
socket2version. #1803
- Ensure
actix-httpdependency uses sameserde_urlencoded.
- Add
Either<A, B>extractor helper. #1788
- Upgrade
serde_urlencodedto0.7. #1773
- Implement
exclude_regexfor Logger middleware. #1723 - Add request-local data extractor
web::ReqData. #1748 - Add ability to register closure for request middleware logging. #1749
- Add
app_datatoServiceConfig. [#1757] - Expose
on_connectfor access to the connection stream before request is handled. #1754
- Updated actix-web-codegen dependency for access to new
#[route(...)]multi-method macro. - Print non-configured
Data<T>type when attempting extraction. #1743 - Re-export bytes::Buf{Mut} in web module. #1750
- Upgrade
pin-projectto1.0.
- Add
TrailingSlash::MergeOnlybehaviour toNormalizePath, which allowsNormalizePathto retain any trailing slashes. #1695 - Remove bound
std::marker::Sizedfromweb::Datato support storingArc<dyn Trait>viaweb::Data::from#1710
ResourceMapdebug printing is no longer infinitely recursive. #1708
NormalizePathwhen used withTrailingSlash::Trimno longer trims the root path "/". #1678
middleware::normalize::TrailingSlashenum is now accessible. #1673
- No significant changes from
3.0.0-beta.4.
middleware::NormalizePathnow has configurable behavior for either always having a trailing slash, or as the new addition, always trimming trailing slashes. #1639
- Update actix-codec and actix-utils dependencies. #1634
FormConfigandJsonConfigconfigurations are now also considered when set usingApp::data. #1641HttpServer::maxconnis renamed to the more expressiveHttpServer::max_connections. #1655HttpServer::maxconnrateis renamed to the more expressiveHttpServer::max_connection_rate. #1655
- Update
rustlsto 0.18
PayloadConfigis now also considered inBytesandStringextractors when set usingApp::data. #1610web::Pathnow has a public representation:web::Path(pub T)that enables destructuring. #1594ServiceRequest::app_dataallows retrieval of non-Data data without splitting into parts to accessHttpRequestwhich already allows this. #1618- Re-export all error types from
awc. #1621 - MSRV is now 1.42.0.
- Memory leak of app data in pooled requests. #1609
- Re-export
actix_rt::mainasactix_web::main. HttpRequest::match_patternandServiceRequest::match_patternfor extracting the matched resource pattern.HttpRequest::match_nameandServiceRequest::match_namefor extracting matched resource name.
- Fix actix_http::h1::dispatcher so it returns when HW_BUFFER_SIZE is reached. Should reduce peak memory consumption during large uploads. [#1550]
- Migrate cookie handling to
cookiecrate. Actix-web no longer requiresringdependency. - MSRV is now 1.41.1
NormalizePathimproved consistency when path needs slashes added and removed.
- Add option to create
Data<T>fromArc<T>#1509
- Resources and Scopes can now access non-overridden data types set on App (or containing scopes) when setting their own data. #1486
- Fix audit issue logging by default peer address #1485
- Bump minimum supported Rust version to 1.40
- Replace deprecated
net2crate withsocket2
{Resource,Scope}::default_service(f)handlers now support app data extraction. #1452- Implement
std::error::Errorfor our custom errors #1422 - NormalizePath middleware now appends trailing / so that routes of form /example/ respond to /example requests. #1433
- Remove the
failurefeature and support.
- Add helper function for creating routes with
TRACEmethod guardweb::trace() - Add convenience functions
test::read_body_json()andtest::TestRequest::send_request()for testing.
- Use
sha-1crate instead of unmaintainedsha1crate - Skip empty chunks when returning response from a
Stream#1308 - Update the
timedependency to 0.2.7 - Update
actix-tlsdependency to 2.0.0-alpha.1 - Update
rustlsdependency to 0.17
-
Rename
HttpServer::start()toHttpServer::run() -
Allow to gracefully stop test server via
TestServer::stop() -
Allow to specify multi-patterns for resources
-
Move
BodyEncodingtodevmodule #1220 -
Allow to set
peer_addrfor TestRequest #1074 -
Make web::Data deref to Arc #1214
-
Rename
App::register_data()toApp::app_data() -
HttpRequest::app_data<T>()returnsOption<&T>instead ofOption<&Data<T>>
- Fix
AppConfig::secure()is always false. #1202
- Fixed compilation with default features off
- Add test server,
test::start()andtest::start_with()
- Delete HttpServer::run(), it is not useful with async/await
- Migrate to tokio 0.2
-
Migrated to
std::future -
Remove implementation of
Responderfor(). (#1167)
- Add
Payload::into_innermethod and make storeddef::Payloadpublic. (#1110)
- Support
Hostguards when theHostheader is unset (e.g. HTTP/2 requests) (#1129)
-
Add
Scope::register_dataandResource::register_datamethods, parallel toApp::register_data. -
Add
middleware::Conditionthat conditionally enables another middleware -
Allow to re-construct
ServiceRequestfromHttpRequestandPayload -
Add
HttpServer::listen_udsfor ability to listen on UDS FD rather than path, which is useful for example with systemd.
-
Make UrlEncodedError::Overflow more informative
-
Use actix-testing for testing utils
- Request Extensions leak #1062
-
Re-implement Host predicate (#989)
-
Form implements Responder, returning a
application/x-www-form-urlencodedresponse -
Add
into_innertoData -
Add
test::TestRequest::set_form()convenience method to automatically serialize data and set the header in test requests.
-
Querypayload madepub. Allows user to pattern-match the payload. -
Enable
rust-tlsfeature for client #1045 -
Update serde_urlencoded to 0.6.1
-
Update url to 2.1
-
Unix domain sockets (HttpServer::bind_uds) #92
-
Actix now logs errors resulting in "internal server error" responses always, with the
errorlogging level
- Restored logging of errors through the
Loggermiddleware
-
Add
Responderimpl for(T, StatusCode) where T: Responder -
Allow to access app's resource map via
ServiceRequest::resource_map()andHttpRequest::resource_map()methods.
- Upgrade
randdependency version to 0.7
- Support asynchronous data factories #850
- Use
encoding_rscrate instead of unmaintainedencodingcrate
-
Move cors middleware to
actix-corscrate. -
Move identity middleware to
actix-identitycrate.
-
Add support for PathConfig #903
-
Add
middleware::identity::RequestIdentitytrait toget_identityfromHttpMessage.
-
Move cors middleware to
actix-corscrate. -
Move identity middleware to
actix-identitycrate. -
Disable default feature
secure-cookies. -
Allow to test an app that uses async actors #897
-
Re-apply patch from #637 #894
- HttpRequest::url_for is broken with nested scopes #915
-
Add
Scope::configure()method. -
Add
ServiceRequest::set_payload()method. -
Add
test::TestRequest::set_json()convenience method to automatically serialize data and set header in test requests. -
Add macros for head, options, trace, connect and patch http methods
- Drop an unnecessary
Option<_>indirection aroundServerBuilderfromHttpServer. #863
-
Fix Logger request time format, and use rfc3339. #867
-
Clear http requests pool on app service drop #860
- Add
Query<T>::from_query()to extract parameters from a query string. #846 QueryConfig, similar toJsonConfigfor customizing error handling of query extractors.
JsonConfigis nowSend + Sync, this implies thaterror_handlermust beSend + Synctoo.
- Codegen with parameters in the path only resolves the first registered endpoint #841
- Allow to set/override app data on scope level
App::configuretake anFnOnceinstead ofFn- Upgrade actix-net crates
- Add helper function for executing futures
test::block_fn()
-
Extractor configuration could be registered with
App::data()or withResource::data()#775 -
Route data is unified with app data,
Route::data()moved to resource level toResource::data() -
CORS handling without headers #702
-
Allow constructing
Datainstances to avoid doubleArcforSend + Synctypes.
- Fix
NormalizePathmiddleware impl #806
App::data_factory()is deleted.
-
Add raw services support via
web::service() -
Add helper functions for reading response body
test::read_body() -
Add support for
remainder match(i.e "/path/{tail}*") -
Extend
Respondertrait, allow to override status code and headers. -
Store visit and login timestamp in the identity cookie #502
.to_async()handler can returnRespondertype #792
- Fix async web::Data factory handling
-
Add helper functions for reading test response body,
test::read_response()and test::read_response_json()` -
Add
.peer_addr()#744 -
Add
NormalizePathmiddleware
-
Rename
RouterConfigtoServiceConfig -
Rename
test::call_successtotest::call_service -
Removed
ServiceRequest::from_parts()as it is unsafe to create from parts. -
CookieIdentityPolicy::max_age()accepts value in seconds
- Fixed
TestRequest::app_data()
-
Allow using any service as default service.
-
Remove generic type for request payload, always use default.
-
Removed
Decompressmiddleware. Bytes, String, Json, Form extractors automatically decompress payload. -
Make extractor config type explicit. Add
FromRequest::Configassociated type.
- Added async io
TestBufferfor testing.
- Removed native-tls support
-
App::configure()allow to offload app configuration to different methods -
Added
URLPathoption for logger -
Added
ServiceRequest::app_data(), returnsData<T> -
Added
ServiceFromRequest::app_data(), returnsData<T>
-
FromRequesttrait refactoring -
Move multipart support to actix-multipart crate
- Fix body propagation in Response::from_error. #760
-
Renamed
TestRequest::to_service()toTestRequest::to_srv_request() -
Renamed
TestRequest::to_response()toTestRequest::to_srv_response() -
Removed
Derefimpls
- Removed unused
actix_web::web::md()
- Rustls support
-
Use forked cookie
-
Multipart::Field renamed to MultipartField
-
Complete architecture re-design.
-
Return 405 response if no matching route found within resource #538