abp icon indicating copy to clipboard operation
abp copied to clipboard

HTTP PUT & HTTP DELETE request not working on hosted application on IIS

Open vipulbuoyancy opened this issue 1 year ago • 3 comments

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

vipulbuoyancy avatar May 29 '24 11:05 vipulbuoyancy

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.

maliming avatar May 30 '24 02:05 maliming

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.

vipulbuoyancy avatar May 30 '24 18:05 vipulbuoyancy

hi

I have no idea. : )

maliming avatar May 31 '24 01:05 maliming

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.

tiennvn avatar Jun 01 '24 02:06 tiennvn

try remove WebDAVModule from IIS

rqx110 avatar Jun 03 '24 06:06 rqx110