U
U
UniverseElement2019-04-15 18:54:37
ASP.NET
UniverseElement, 2019-04-15 18:54:37

Why Get requests can be sent 2 times?

There is a web service - the utility communicates with the ASP.NET MVC web server. Most clients work as expected, but a couple of clients are behaving very strangely - each get request is sent 2 times with a difference of a few seconds. Judging by the server logs, the utility sends the first request from the local ip-address, and the second request is repeated from different addresses of the Amazon Internet provider (the utility works on servers located in the data center). M.b. Has anyone come across how this is possible? What can provoke such strange behavior?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vladimir Dubrovin, 2019-04-15
@z3apa3a

This can be for many reasons - enabled preload on the client, the user clicked "back" or refreshed the page, but in this case - most likely the user has some kind of extension that "knocks" his browsing history out, perhaps even malicious or vice versa it is an antivirus that checks for potentially harmful content.
There is a general rule - a GET request should never result in modifying actions on the server. Any modifying actions must be done via POST or other methods (in the case of a REST API).
If it is nevertheless necessary that it be GET, then it is customary to additionally protect against repeated requests (replay), usually a sequence number or a random addition is added to the request.

U
UniverseElement, 2019-04-15
@UniverseElement

In this case, user actions are excluded (the utility works automatically) and it seems to me that even if the utility adds a serial number to the request, it will be duplicated in this form.

M
mletov, 2019-07-03
@mletov

It was about the same. I also sent data via the API and for some reason the requests were duplicated.
It turned out that one of the servers receiving the request had a long response, the request fell off and a new one was immediately sent - the increase in the timeout when sending helped.
Maybe this is not your case, but try it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question