共用方式為


HttpBaseProtocolFilter.AllowAutoRedirect 屬性

定義

取得或設定值,指出 HttpBaseProtocolFilter 是否應遵循重新導向回應。

public:
 property bool AllowAutoRedirect { bool get(); void set(bool value); };
bool AllowAutoRedirect();

void AllowAutoRedirect(bool value);
public bool AllowAutoRedirect { get; set; }
var boolean = httpBaseProtocolFilter.allowAutoRedirect;
httpBaseProtocolFilter.allowAutoRedirect = boolean;
Public Property AllowAutoRedirect As Boolean

屬性值

Boolean

bool

值,指出 HttpBaseProtocolFilter 是否應該遵循重新導向回應。

如果HttpBaseProtocolFilter應遵循重新導向回應,則此值為true;否則為 false。 預設值為 true

備註

如果您希望HttpBaseProtocolFilter自動遵循 HTTP 重新導向標頭至資源的新位置,請將 AllowAutoRedirect 設定為true。 系統會在內部設定要遵循的重新導向數目上限。

如果 AllowAutoRedirect 設定為 false,則所有 HTTP 狀態碼從 300 到 399 的 HTTP 回應都會傳回至任何稱為 HttpBaseProtocolFilter 的 HTTP回應,這可能會有另一個可能會將它們傳回給應用程式的篩選準則。

自動重新導向會清除 授權 標頭, 而 HttpBaseProtocolFilter 會自動嘗試重新驗證至重新導向的位置。 實際上,這表示如果可能遇到重新導向,應用程式就無法將自訂驗證資訊放入 授權 標頭中。 相反地,應用程式必須使用篩選來實作自訂驗證模組。

適用於