Single webhook calls to website resulting in multiple http calls.

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
theMCXP
New to forums
New to forums
Posts: 6
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Wed Jul 20, 2011 11:32 am

Single webhook calls to website resulting in multiple http calls.

Post by theMCXP »

I've noticed with several different scripts that when I call scripts on my server, it looks like multiple http calls occur. This results in my personal log files having multiple entries of the same call etc.

I have confirmed with the source server that only 1 call is made to NFO, yet looking at the access.log, you can see multiple calls within milliseconds.

ex:
REDACTED - - [01/Jul/2022:10:17:28 -0700] "POST /shipping/index.php HTTP/1.1" 200 190 "-" "Ruby"
REDACTED - - [01/Jul/2022:10:17:33 -0700] "POST /shipping/index.php HTTP/1.1" 200 190 "-" "Ruby"

Could this have anything to do with rewrite rules? I poked around the net, and some people reported fixing this behaviour after adding a favicon.ico /favicon.png to the root folder... ie: when index.php is called, apparently it also tried to load favicon, but since the file didn't exit, it rewrite to forward the request to index.php again? I've added the files now to the directory yet it's still doing it.

Any tips or insight on how this can be happening?
User avatar
Edge100x
Founder
Founder
Posts: 12945
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Single webhook calls to website resulting in multiple http calls.

Post by Edge100x »

Are you certain that the source server is not making multiple calls? You should be able to check this by making a packet capture there, if you aren't sure.

The two calls that you show were 5 seconds apart.
theMCXP
New to forums
New to forums
Posts: 6
Joined: Wed Jul 20, 2011 11:32 am

Re: Single webhook calls to website resulting in multiple http calls.

Post by theMCXP »

Oh you're right! It is 5 seconds, not sure why I misread that. I'm almost certain that it's only sending once. It's a large e-commerce platform's web hook so I just convinced myself it's not possible otherwise many thousands of people would have noticed this behaviour.

On that note, now that you pointed out it was 5 seconds... I wonder if its sending a second call after 5 seconds because it didn't receive the 200 response from my script.

Off to figure out how to respond 200 in php before running the rest of my code.

Any other ideas of how else this could be possible?
Naleksuh
This is my homepage
This is my homepage
Posts: 298
Joined: Thu Jul 25, 2019 12:35 am

Re: Single webhook calls to website resulting in multiple http calls.

Post by Naleksuh »

I agree with Edge100x, it is clear that there are multiple requests from the source. Also, 200 response should happen by default if there are no problems. You can check that in your browser developer tools Network tab.
theMCXP
New to forums
New to forums
Posts: 6
Joined: Wed Jul 20, 2011 11:32 am

Re: Single webhook calls to website resulting in multiple http calls.

Post by theMCXP »

I'm thinking my script could be processing for too long and the source is making another call.

However, I just checked and their timeout and retry is actually 10 seconds, not 5. So this is indeed confusing me some more.

If I run the web hook to "webhook.site" to test with, it definitely only sends 1 request.
User avatar
Edge100x
Founder
Founder
Posts: 12945
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Single webhook calls to website resulting in multiple http calls.

Post by Edge100x »

It seemed to send the 200 response. I'd recommend having the script log its inputs and how long it takes to run to check on those things (to see if it's receiving the same form data and if it might be taking too long to process).
Post Reply