Open Closed

POST, PUT, and DELETE requests return a Bad Request (400) error #7937


User avatar
0
serhatuysal created
  • ABP Framework version: v8.1.0

  • UI Type: Angular

  • Database System: EF Core (SQL Server)

  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

  • Exception message and full stack trace:

  • Steps to reproduce the issue:

  • Hello,

    After publishing an Angular project to IIS in the production environment, when the resolution width is smaller than 1200px, POST, PUT, and DELETE requests return a Bad Request (400) error. Only GET requests return 200. However, when the resolution is larger than 1200px, the application works without any issues.

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

13 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    could you please share the error logs?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    serhatuysal created

    2024-09-19 08:16:52.688 +03:00 [INF] Request starting HTTP/1.1 POST http://iktest...tr/api/api/app/home/yayinda-olan-ilan-listesi - null 0 2024-09-19 08:16:52.688 +03:00 [INF] CORS policy execution successful. 2024-09-19 08:16:52.710 +03:00 [INF] Executing endpoint 'InsanKaynaklari.Homes.HomeAppService.yayindaOlanIlanListesi (InsanKaynaklari.Application)' 2024-09-19 08:16:52.710 +03:00 [INF] Route matched with {action = "yayindaOlanIlanListesi", controller = "Home", area = "", page = ""}. Executing controller action with signature System.Threading.Tasks.Task1[System.Collections.Generic.List1[InsanKaynaklari.Ilans.YayindakiIlanDto]] yayindaOlanIlanListesi() on controller InsanKaynaklari.Homes.HomeAppService (InsanKaynaklari.Application). 2024-09-19 08:16:52.710 +03:00 [WRN] The provided antiforgery token was meant for a different claims-based user than the current user. 2024-09-19 08:16:52.711 +03:00 [INF] Authorization failed for the request at filter 'Volo.Abp.AspNetCore.Mvc.AntiForgery.AbpAutoValidateAntiforgeryTokenAuthorizationFilter'. 2024-09-19 08:16:52.711 +03:00 [INF] Executing StatusCodeResult, setting HTTP status code 400 2024-09-19 08:16:52.711 +03:00 [INF] Executed action InsanKaynaklari.Homes.HomeAppService.yayindaOlanIlanListesi (InsanKaynaklari.Application) in 0.5579ms 2024-09-19 08:16:52.711 +03:00 [INF] Executed endpoint 'InsanKaynaklari.Homes.HomeAppService.yayindaOlanIlanListesi (InsanKaynaklari.Application)' 2024-09-19 08:16:52.718 +03:00 [INF] Request finished HTTP/1.1 POST https://iktest...tr/api/api/app/home/yayinda-olan-ilan-listesi - 400 0 null 29.8056ms

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    The provided antiforgery token was meant for a different claims-based user than the current user.

    Hi,

    This is a problem related to CSRF.

    could you please share the full steps to reproduce? I will check it out

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    serhatuysal created

    Angular project or InsanKaynaklari.HttpApi.Host project? Do you have a remote connection and review status? The project needs to be completed quickly. please

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Angular project or InsanKaynaklari.HttpApi.Host project?

    both of them.

    The project needs to be completed quickly. please

    if you can share the steps, i will check it know

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    serhatuysal created

    Can you please connect via remote desktop?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    How do I do that?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    serhatuysal created

    Can you share your email address and I will send you remote connection information?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    okay shiwei.liang@volosoft.com

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    The problem is ng sends the wrong cookies to the API backend.

    These cookies come from the SSO server.

    you can set different cookie path for your SSO server

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer
    // your SSO project
    context.Services.ConfigureApplicationCookie(options =>
    {
        options.Cookie.Path = "/auth"; // or /sso anything you wants
    });
    Configure<AbpAntiForgeryOptions>(options =>
    {
        options.TokenCookie.Path = "/auth";
    });
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    https://stackoverflow.com/questions/49389306/stop-sharing-cookies-between-applications-under-same-site-id-in-iis

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    masum.ulu created
    Angular Expert

    Selamlar, sorunu anlayıp çözümü uygulayabildiniz mi acaba ?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on October 05, 2026, 11:32
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.