2011-11-25 57 views
0

我試圖通過使用反僞造令牌來處理重複的表單發佈作爲回答here問題出現時,重複相同的表單post請求到達它被成功識別,但我無法處理它正常。我做殺死一個http post請求

if (ctx.Session["userform"] != null) 
    { 
     if (_antiForgToken.Equals(ctx.Session["userform"].ToString())) 
     { 
      //kill the request 
      response.Clear(); 
      response.ClearContent(); 
      response.Close(); 
     } 
    } 
    else 
     ctx.Session["userform"] = _antiForgToken;   
} 

的問題是,我怎麼能剛落複製的HTTP請求,就好像它從來沒有發生過......

回答

1

你仍然需要由客戶正確和公正殺死提出的要求作出迴應該反應將無濟於事。可能發送一個狀態碼爲400的響應。

400 Bad Request 

The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.