All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- added permissions and owner to UnixListener #668
- In the examples, listen on
0.0.0.0`` instead of
127.0.0.1``#672 - Add support for wildcard '*' in cors domains #563
- bump
rust-embed
from6.3
to8.0
- bump
quick-xml
from0.29.0
to0.30.0
- bump
syn
from1.0
to2.0
- allow not falling back to index file #524
- Public path pattern #522
- feat: add
just_at
method for Router #530 - fix: alive connections counter for graceful shutdown #526
- chore: update
deps
shields. bumptokio-metrics
#532 - Trivial doc change to add
test
to the list of optional #570 - feat: upsert default_headers to dynamically change while testing #569
- fix(server): graceful shutdown of established connections #550
- fix: export real error
RedisSessionError
forredis-session
[#501](fix: export real errorRedisSessionError
forredis-session
) - Add From implementation for I18NArgs #507
- fix errors when parse yaml & xml request #498
- fix
SSE::keep_alive
caused the event stream to not terminate properly.
- fix: static_files percent encode filename #495
- bump
tokio-tungstenite
from0.17.1
to0.18.0
#463 - bump base64 from
0.13.0
to0.21.0
- Add yaml support #476
- More compact packing of random bytes in session_id #437
- Fixes opentelemetry_metrics: Correct duration conversion #449
- Support fall back to the index file when serving static files #450
- Record and use PathPattern in response #462
- listener::rustls: add support for elliptic curve private keys #460
- Add
Error::set_error_message
to change the error message
- Fixes not enough randomness in session keys #430
- Bump
quick-xml
to0.26.0
- Fixes #416
- Re-enable the
brotli
compression algorithm. - Add
Compress::with_quality
andCompression::with_quality
methods. - Add
Compression::algorithms
to specify the enabled algorithms. - Make
WebSocketUpgraded<T>
andBoxWebSocketUpgraded
public #415
- Add
Error::is_from_response
method.
- Add
Error::status
method to get the status code of error.
- Removed dependency on
typed-headers
. #394
- Fixed
StaticFileEndpoint
returning an incorrectContent-Length
header when aRange
header is in the request. - Fixed
Compression
middleware returning incorrectContent-Length
header. - Disabled
brotli(CompressionAlgo::BR)
algorithm, very slow, still looking for the reason.
- Use the real IP as the
remote_addr
in the logs of the Tracing middleware. #370 - Automatically decode percent-encoded path parameters. #375
- Fix: trace nested route with original uri. #371
- Automatically decode percent-encoded path parameters. #375
- Add
ForceHttps::filter
method to determine if a request should be redirect. #360 - Add
content-length
forStaticFileResponse
#373
- CORS middleware use 403 instead of 401. #368
- Expose libcookie
iter()
#361
- Add
StaticFilesEndpoint::redirect_to_slash_directory
to enable Redirects to a slash-ended path when browsing a directory. - Add
has_source
method topoem::Error
#349 - Use
LENGTH_REQUIRED
instead ofBAD_REQUEST
inSizeLimit
middleware #348
- Expose macro
impl_apirequest_for_payload
for custom payload type and add an example to demonstrating the custom payload. #309 - Add
Accept
extractor. - Add
TcpAcceptor::from_tokio
method. #317
- Chose Compress algorithm with priority #302
- Increase the MSRV to
1.61
- Add XML support #297
- Add
RealIp
extractor
- Add openssl TLS listener. #289
- Fix route variable matching incorrectly. #275
- Add support for multiple domains to
RustlsConfig
. - Bump
rustls-pemfile
from0.3.0
to1.0.0
.
Do not include a body for HTTP 304#257- An error created by a status code should be converted to a response without a body.
- Integrate with
rust-embed
. #251
- Make the
AutoCert
middleware to register an account only when it needs to create a new certificate.
- Add
CatchPanic
middleware.
- Add the ability for parameters to come from urlencoded forms. #245
- Add
server
feature. (enable by default) - Change
Error::as_response
toError::into_response
.
- Add
Cache-Control: no-cache
header to SSE response. - Add
TokioMetrics
middleware. #206
- Check the
Content-type
when useJson
extractor. #236 - Add
EndpointExt::data_opt
method.
- Make all test cases use
poem::test
.
- Fix Poem with Tonic doesn't return GRPC status header when rpc handler returns an error. #212
- Fix Poem with Tonic doesn't return GRPC status header. #212
- Change charset from
utf8
toutf-8
. #213
- Add
X-Accel-Buffering: no
header to SSE response. - Add
AutoCertBuilder::contact
method to add a contact email for ACME account. - Add
TestJsonArray::assert_is_empty
andTestJsonObject::assert_is_empty
methods. - Add
TestJsonArray::assert_contains
andTestJsonObject::assert_contains_exactly_one
methods.
- Fixed
AutoCert
loading cached certificates with incorrect paths.
- Implement
Listener
forBoxListener
.
- Add
ListenerExt::boxed
method.
- Add
Body::is_empty
method. - Add
RouteScheme
for scheme routing. - Add support
HTTP-01
challenge for ACME.
- Add support for ACME(Automatic Certificate Management Environment).
- Add
Response::set_content_type
method. - Add
IntoResponse::with_content_type
method.
- Fix session renew gets overwritten by session change. #196
- Integrate with
eyre
. #190 - Bump
tokio-rustls
from0.22.0
to0.23.2
. - Add default response type to
BoxEndpoint
.
- Replace
SystemTime
withInstant
in tracing middleware. #187
- Make the
StaticFileRequest::create_response
method correctly returnErr(StaticFileError::NotFound)
when the specified file does not exist.
- The
Content-Type
header of theHtml
response was changed fromtext/html
totext/html; charset=utf8
.
- Add
TestJsonValue::assert_not_null
method.
- Add
TestRequestBuilder::typed_header
method.
- Changed the return error type of multipart related methods from
IoError
toParseMultipartError
. - Add
TestRequestBuilder::form
method. - Add more examples to
poem::test
.
Redirect
parameter type changed toimpl Display
. #176
- Fix crash caused by invalid request URI. #174
- Add
Body::into_bytes_limit
method.
- Add
TestJsonArray::get_opt
andTestJsonObject::get_opt
methods.
- Add
EndpointExt::to_response
method.
- Add
TcpAcceptor::from_std
andUnixAcceptor::from_std
methods. - Add support for multipart tests.
- Add
I18NArgs::set
method.
- Change the behavior of the
TestClient::query
method to add a KV pair.
- Add
SensitiveHeader
middleware.
- Add support handling
Range
header for theStaticFile
extractor. - Add
ResponseError::as_response
method.
- Rename
poem::endpoint::StaticFiles
topoem::endpoint::StaticFilesEndpoint
. - Rename
poem::endpoint::StaticFile
topoem::endpoint::StaticFileEndpoint
. - Add
poem::web::StaticFileRequest
extractor.
- Add I18N support with
fluent
.
- Add test utilities.
RouteMethod
returnsMethodNotAllowedError
error instead ofNotFoundError
when the corresponding method is not found.
- Fixed the
Cors
middleware to return incorrect headers when an error occurs.
- Bump
cookie
crate from0.15.1
to0.16
.
- Add
FromRequest:: from_request_without_body
method.
- Fix panic when accessing HTTPS endpoint with HTTP. #141
- Add
ForceHttps::https_port
method.
- Improve TLS listeners.
- Rename
poem::endpoint::Files
topoem::endpoint::StaticFiles
. - Add
poem::endpoint::StaticFile
to handing single static file.
- Add
Request::scheme
method. - Add
ForceHttps
middleware.
- Add
Files
endpoint support forIf-None-Match
,If-Modified-Since
,If-Match
,If-Unmodified-Since
headers.
- Add
Response::is_ok
method to check the status code of response is200 OK
.
- Add
Request::uri_str
method.
- Add
Route::try_at
,Route::try_nest
,Route::try_nest_no_strip
methods. - Add
RouteDomain::try_at
method. - Rename
RouteDomain::add
toRouteDomain::at
.
- Fix session data is serialized twice. #109
- Panic when there are duplicates in the routing table. #126
- Add error messages to the tracing middleware.
- Rename
EndpointExt::inspect_error
toEndpointExt::inspect_all_error
. - Rename
EndpointExt::inspect_typed_error
toEndpointExt::inspect_error
. - Add
EndpointExt::catch_all_error
method.
- Add
Endpoint::get_response
method.
- Add
EndpointExt::inspect_typed_err
method. - Rename
Error::new_with_string
toError::from_string
. - Rename
Error::new_with_status
toError::from_status
. - Integrate with the
anyhow
crate.
- Refactor error handling.
- The return value type of the
Endpoint::call
function is changed fromSelf::Output
toResult<Self::Output>
. - Remove the associated type
Error
fromFromRequest
. - The return value of the
FromRequest::from_request
function is changed fromResult<Self, Self::Error>
toResult<Self>
. - Add some helper methods to
EndpointExt
.
- Add
Body::from_bytes_stream
andBody::to_bytes_stream
methods. - Remove the
BinaryStream
type, usepoem::Body
instead.
- Remove
nom
from dependencies.
- Rename
Request::deserialize_path
toRequest::path_params
,Request::deserialize_query
toRequest::params
. - Rename
Request::path_param
toRequest::raw_path_param
.
- Add helper methods
Request::deserialize_path
andRequest::deserialize_query
. - Rename
error::ErrorInvalidPathParams
toerror::ParsePathError
.
- Implement
FromRequest
forLocalAddr
.
- Remove
akasma
from dependencies.
- Add CSRF middleware. #98
- Add
Request::header
andResponse::header
methods.
Server::new
is no longer an asynchronous method and has no return value.- Remove
Server::local_addr
method. - Add the
Server::name
method to specify the name of the server, it is only used for logs.
- Add
EndpointExt::with_if
method.
- Use percent-encoding before adding cookies to the header.
- Fix
CookieJar
does not support parsing from multipleCookie
headers. - Fix websocket not working in
Firefox
. #91
- Fix Cors middleware response incorrect
Access-Control-Allow-Headers
header.
- Fix the bug that
Cookie::http_only
sets incorrect attributes.
- Add
PropagateHeader
middleware.
- Add
MemoryStore
for session. - Add
from_json::from_json
andBody::into_json
methods. - Add support for
native-tls
.
- Support TLS rotation.
- Add
template
andstaticfiles
features.
- Improve
EndpointExt::around
.
- Add
Request::data
,Request::set_data
,Response::data
andResponse::set_data
methods. - Use Rust 2021 edition.
- Remove some useless code.
- Add
Cors::allow_headers
,Cors::allow_methods
,Cors::allow_origins
andCors::expose_headers
methods.
- Use
Request::take_upgrade
instead ofRequest::upgrade
method.
- Add
AcceptorExt::tls
method.
- Implements
From<T: Display>
forError
.
- Move the HTTP error helper functions to the
error
module.
- Add
LocalAddr
extractor. - Add
Request::local_addr
method.
- Add
SizeLimit
middleware. - Move the trace log in
serve_connection
to the newTracing
middleware.
- Update some docs.
Cors
middleware allows all HTTP methods and headers by default.- Add
Cors::allow_origins_fn
method.
- Add
RouteDomain
forHost
header routing. - Add
CookieSession
andRedisSession
middlewares. - Add
RequestBuilder::typed_header
andResponseBuilder::typed_header
methods. - Improve Cors middleware.
- Remove the
'static
constraint ofEndpoint
. - Add
EndpointExt::around
method.
- Change the trait bounds of
FromRequest::Error
fromInto<Error>
toIntoResponse
. - Implements
IntoResponse
forBody
. - The
CookieJar::private
andCookieJar::signed
methods now use the key specified byCookieJarManager::with_key
.