allowed_hosts

class litestar.middleware.allowed_hosts.AllowedHostsMiddleware[原始碼]

基底類別:AbstractMiddleware

Middleware ensuring the host of a request originated in a trusted host.

__init__(app: ASGIApp, config: AllowedHostsConfig) None[原始碼]

初始化 AllowedHostsMiddleware

參數:
  • app -- The next ASGI app to call.

  • config -- An instance of AllowedHostsConfig.