-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http response status code 404 when using go version >= 1.17 #1296
Comments
fasthttp doesn't do anything specific based on the Go version. But nothing in the Go version should make the response change as it would result in exactly the same request going out. I'm also getting % curl -v 'https://ads-api.twitter.com/10/conversion_event'
* Trying 104.244.42.3:443...
* Connected to ads-api.twitter.com (104.244.42.3) port 443 (#0)
...
> GET /10/conversion_event HTTP/1.1
> Host: ads-api.twitter.com
> User-Agent: curl/7.79.1
> Accept: */*
>
< HTTP/1.1 404 Not Found
< date: Tue, 10 May 2022 15:49:53 GMT
< server: tsa_o
< set-cookie: guest_id=v1%3A165219779441443467; Max-Age=34214400; Expires=Sat, 10 Jun 2023 15:49:54 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None
< content-type: application/json; charset=utf-8
< cache-control: no-cache, no-store, max-age=0
< content-length: 143
< timing-allow-origin: https://twitter.com, https://mobile.twitter.com
< strict-transport-security: max-age=631138519
< x-response-time: 121
< x-connection-hash: d822072afd507850d79e0495178bfa42f7165d61d68a1d4a3fedff188ea93115
<
* Connection #0 to host ads-api.twitter.com left intact
{"errors":[{"code":"ROUTE_NOT_FOUND","message":"The requested resource could not be found"}],"request":{"params":{"*":"10\/conversion_event"}} |
it should be used with |
They seem to have some kind of "spam" detection. Even if you add this: req.Header.SetUserAgent("curl/7.79.1")
req.Header.Set("Accept", "*/*")
req.Header.SetContentType("application/x-www-form-urlencoded") Which makes fasthttp send:
You will get a 404. Even though curl sends the same request (just the order of the headers is different) and gets a 401 with this:
Nothing you can do about this. |
The issue is that I'm not really expecting to get And when I ran some local tests, it seems to consistently failing with |
That could be the same "spam" detection on twitters end. The only thing I can imagine changing between those Go versions is is maybe some TCP timing or settings. Have you tried downgrading again to see if it works again? Was the Go version really the only thing you changed? |
Yes, the only thing that changed is go version :) when I downgrade the version its working again :) |
I'm afraid all I can say is that fasthttp does nothing different based on the Go version. |
when using net/http with go
perhaps it can give a direction, whats the main difference between net/https vs fasthttp in terms of using the golang core lib? |
The main difference is the order of headers and some different values of headers. But they are all valid requests which again shows me that it's some twitter spam filter. |
After debugging it more, the
However I don't have enough understanding of how the Any idea/direction of what may it be? I've also tried setting the |
It could be that something in the session cache changed in Go >= 17, I'm not aware of any changes. It would be weird if this has any impact on the request to twitter, but I guess it could somehow trigger their spam filter which looks at things like tls properties. I don't know how If this really fixes it then it's probably best to fork fasthttp for your use and remove this line: Line 1904 in b40b5a4
Of course the best solution would be for Twitter to fix this issue, but I don't see that happening easily. |
net/http doesn't use it either. Some servers have issues with this preventing fasthttp from working: valyala#1364 valyala#1296 valyala#1335 valyala#984 Also removed code that benchmarks crypto/tls as that has nothing to do with fasthttp.
I have the following code sample:
fasthttp version is
v1.36.0
when I ran the code with go
1.15
/1.16
I'm getting401
status code as expected.But when I ran it with go
1.17
/1.18
I'm am getting404
, I'm not sure where is the issue here, whether its in golang or fasthttp? will appreciate your help pleaseThe text was updated successfully, but these errors were encountered: