Score:0

403 Forbidden after 10 POSTs

ke flag

Problem/Motivation

Repeated posting a redhen_contact via the Drupal JSON:API succeeds for exactly 10 times in a row. The 11th attempt fails with 403 status code. After waiting for 60-120 seconds, the next 10 POSTs succeed again.

BasicAuth is used, user account has the necessary permissions, also affects user 1. Strangely, this happens with the redhen_contact entity type only, entities of type redhen_organization or redhen_connection are not affected. Drupal core 9.5.9 RedHen CRM 2.0.0-rc1, same behavior with 8.x-1.0

Any hints what the cause of this strange problem could be are highly appreciated!

Steps to reproduce

POST with postman or any other client, 11 times Request header: 'Accept': 'application/vnd.api+json', 'Content-Type': 'application/vnd.api+json'

Example request body:

{"data": {
    "type": "redhen_contact--crm_cont_pers", 
    "attributes": {
      "first_name": "John", 
      "middle_name": null, 
      "last_name": "Smith", 
      "email": null
    }
  }
 }

Response on request #1-10:

201 Created

Response on request #11:

403 Forbidden

Forbidden You don't have permission to access this resource.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

id flag
Is this problem exhibited on all platforms? It's possibly unrelated to Drupal.
Kevin avatar
in flag
Possibly the flood module? Do you have flooding rules on the server otherwise?
jreinholdt avatar
ke flag
@Kevin No, i have'nt installed the flood module
jreinholdt avatar
ke flag
@cliefen Do you mean other hosting platforms? It happens only with one entity type, other types work well - So i suspect it is related to Drupal
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.