소스 검색

Import: say why the upload form-state check failed

The CSRF failure on /import/upload used one generic message. It now tells
apart an empty upload, a missing token, and a session mismatch.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
master
Daniel Covington 2 주 전
부모
커밋
d7b8594a58
1개의 변경된 파일과 7개의 추가작업 그리고 1개의 파일을 삭제
  1. +7
    -1
      app/controllers/ImportController.asp

+ 7
- 1
app/controllers/ImportController.asp 파일 보기

@@ -47,7 +47,13 @@ Class ImportController_Class
up.Upload

If Not Csrf_Valid("import", up.Form("csrf")) Then
Flash().AddError "Invalid form state. Please try again."
If up.FormElements.Count = 0 Then
Flash().AddError "Invalid form state: the upload was not received (" & Request.TotalBytes & " bytes). Please try again."
ElseIf Len(up.Form("csrf")) = 0 Then
Flash().AddError "Invalid form state: the form token was missing from the upload. Please try again."
Else
Flash().AddError "Invalid form state: your session expired or changed. Reload this page and try again."
End If
Response.Redirect "/import"
End If



불러오는 중...
취소
저장

Powered by TurnKey Linux.