ForwardedHeadersOptions.AllowedHosts 屬性

定義

來自 x-forwarded-host 的允許值。 如果清單是空的,則允許所有主機。 無法限制這些值可能會讓攻擊者詐騙服務所產生的連結。

public:
 property System::Collections::Generic::IList<System::String ^> ^ AllowedHosts { System::Collections::Generic::IList<System::String ^> ^ get(); void set(System::Collections::Generic::IList<System::String ^> ^ value); };
public System.Collections.Generic.IList<string> AllowedHosts { get; set; }
member this.AllowedHosts : System.Collections.Generic.IList<string> with get, set
Public Property AllowedHosts As IList(Of String)

屬性值

備註

  • 必須排除連接埠號碼。
  • 最上層萬用字元 「*」 允許所有非空白主機。
  • 允許子域萬用字元。 例如,「*.example.com」 會比對子域,例如 foo.example.com,但不符合父系網域 example.com。
  • 允許 Unicode 主機名稱,但會轉換成 punycode 以進行比對。
  • IPv6 位址必須包含其周框方括弧,且格式為正規化。

適用於