http-v3.3.0

actix/actix-webhttp-v3.3.0Jan 21, 2023by robjtede

AI Summary

This release focuses on HTTP/2 compatibility improvements, performance optimizations for Extensions, and the addition of new header name constants. It also fixes a bug regarding HTTP/2 HEAD responses.

Key Highlights

  • Automatic h2c detection via `HttpService::tcp_auto_h2c()`
  • Improved performance of operations on `Extensions`
  • Added numerous header name constants (e.g., `CACHE_STATUS`, `X_FORWARDED_FOR`)
  • New `HeaderMap::retain()` method
  • Fix for non-empty body of HTTP/2 HEAD responses

New Features

  • MessageBody implementations for `Cow<'static, str>`, `&mut B`, and `Pin<B>`
  • HttpService::tcp_auto_h2c()
  • HeaderMap::retain()
  • Header name constants in header module

Full Release Notes

### Added
- Implement `MessageBody` for `Cow<'static, str>` and `Cow<'static, [u8]>`. [#2959]
- Implement `MessageBody` for `&mut B` where `B: MessageBody + Unpin`. [#2868]
- Implement `MessageBody` for `Pin<B>` where `B::Target: MessageBody`. [#2868]
- Automatic h2c detection via new service finalizer `HttpService::tcp_auto_h2c()`. [#2957]
- `HeaderMap::retain()` [#2955].
- Header name constants in `header` module. [#2956] [#2968]
  - `CACHE_STATUS`
  - `CDN_CACHE_CONTROL`
  - `CROSS_ORIGIN_EMBEDDER_POLICY`
  - `CROSS_ORIGIN_OPENER_POLICY`
  - `PERMISSIONS_POLICY`
  - `X_FORWARDED_FOR`
  - `X_FORWARDED_HOST`
  - `X_FORWARDED_PROTO`

### Fixed
- Fix non-empty body of HTTP/2 HEAD responses. [#2920]

### Performance
- Improve overall performance of operations on `Extensions`. [#2890]

[#2959]: https://github.com/actix/actix-web/pull/2959
[#2868]: https://github.com/actix/actix-web/pull/2868
[#2890]: https://github.com/actix/actix-web/pull/2890
[#2920]: https://github.com/actix/actix-web/pull/2920
[#2957]: https://github.com/actix/actix-web/pull/2957
[#2955]: https://github.com/actix/actix-web/pull/2955
[#2956]: https://github.com/actix/actix-web/pull/2956
[#2968]: https://github.com/actix/actix-web/pull/2968