You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment form data is always sorted alphabetically, because map and net/url.Values sort keys alphabetically (see this issue). However, most browsers send form data in the order in which it appears in the submitted form. This poses an issue when attempting to mimic browser behavior (using client.ImpersonateChrome or client.ImpersonateFirefox) as alphabetically ordered form data can be detected as anomalous, particularly when every other request is honoring the original form order.
My suggestion would be to add request.SetOrderedFormData and client.SetCommonOrderedFormData methods, which accept an ordered map (for example this one) as an argument and set the OrderedFormData field of the request or client respectively. Unfortunately this could create confusion over whether FormData or OrderedFormData takes precedence when both are set. Changing the type of the FormData field from net/url.Values to an ordered map would solve this problem, but would break things for anyone relying on FormData to be of the type net/url.Values.
The text was updated successfully, but these errors were encountered:
At the moment form data is always sorted alphabetically, because
map
andnet/url.Values
sort keys alphabetically (see this issue). However, most browsers send form data in the order in which it appears in the submitted form. This poses an issue when attempting to mimic browser behavior (usingclient.ImpersonateChrome
orclient.ImpersonateFirefox
) as alphabetically ordered form data can be detected as anomalous, particularly when every other request is honoring the original form order.My suggestion would be to add
request.SetOrderedFormData
andclient.SetCommonOrderedFormData
methods, which accept an ordered map (for example this one) as an argument and set theOrderedFormData
field of the request or client respectively. Unfortunately this could create confusion over whetherFormData
orOrderedFormData
takes precedence when both are set. Changing the type of theFormData
field fromnet/url.Values
to an ordered map would solve this problem, but would break things for anyone relying onFormData
to be of the typenet/url.Values
.The text was updated successfully, but these errors were encountered: