2023-05-22 625次浏览

Yii Middleware 1.0 has been released. The package contains a set of the following middleware:

  • CorsAllowAll . Adds CORS headers to the response.
  • ForceSecureConnection Redirects insecure requests from HTTP to HTTPS, and adds headers necessary to enhance the security policy.
  • HttpCache . Implements client-side caching by utilizing the Last-Modified and ETag HTTP headers.
  • IpFilter . Allows access from specified IP ranges only and responds with 403 for all other IPs.
  • Locale . Supports locale-based routing and configures URL generator.
  • Redirect . Generates and adds a Location header to the response.
  • Subfolder . Supports routing when the entry point of the application isn't directly at the webroot.
  • TagRequest . Tags request with a random value that could be later used for identifying it.

The code coverage with unit tests is complete, static analysis meets the requirements of Psalm level 1.

At the later stage of the development it was decided to extract the proxy related middleware to a separate package - Yii Proxy Middleware.