HTTP PUT & HTTP DELETE request not working on hosted application on IIS
Is there an existing issue for this?
- [X] I have searched the existing issues
Description
I have hosted the application on IIS on windows server 2022, Everything is working fine, but PUT & DELETE request throws 400 Bad Request error. When I checked the log, I got the below message
2024-05-29 10:30:11.460 +00:00 [WRN] The required antiforgery header value "RequestVerificationToken" is not present. 2024-05-29 10:30:11.461 +00:00 [INF] Authorization failed for the request at filter 'Volo.Abp.AspNetCore.Mvc.AntiForgery.AbpAutoValidateAntiforgeryTokenAuthorizationFilter'. 2024-05-29 10:30:11.464 +00:00 [INF] Executing StatusCodeResult, setting HTTP status code 400
I am not getting what configuration am I missing as it is working fine on my local machine. Aslo I have checked the header of my local & server request and both seems similar.
Please let me know, What am I missing.
Reproduction Steps
Create New Project, Host it on brand new IIS windows server try to update or delete any entity
Expected behavior
Update & delete requests should work
Actual behavior
Update & delete requests are not working
Regression?
I have tried to add ISAPI features in IIS removing WebDev modules etc.
Known Workarounds
I don't have nay work around for now,
Version
8.1.2
User Interface
Angular
Database Provider
EF Core (Default)
Tiered or separate authentication server
Separate Auth Server
Operation System
Windows (Default)
Other information
No response
hi
Please set the Log level to Debug and share logs.txt.
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.WriteTo.Async(c => c.Console())
.CreateLogger();
Thanks.
Hi @maliming , It started working by its own, I didn't change any configuration on the server. do you know what could be the cause?
Thank you.
hi
I have no idea. : )
I think the API PUT and DELETE contain [Authorize] for action.
Try to create a new simple controller, with the PUT and DELETE method, and test again.
try remove WebDAVModule from IIS