-
Notifications
You must be signed in to change notification settings - Fork 46
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
No Default UA Sent With Requests #2
Comments
@steveamaza could that be the reason for this error { |
I believe so
…On Sun, 29 Apr 2018, 11:12 Ajibola, ***@***.***> wrote:
@steveamaza <https://github.com/steveamaza> could that be the reason for
this error
{
"code": 400,
"details": {},
"url": {
"Scheme": "https",
"Opaque": "",
"User": null,
"Host": "api.paystack.co",
"Path": "/charge",
"RawPath": "",
"ForceQuery": false,
"RawQuery": "",
"Fragment": ""
},
"header": {
"Access-Control-Allow-Origin": [
"*"
],
"Cf-Ray": [
"4130f86afd762993-DUB"
],
"Content-Length": [
"80"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Date": [
"Sun, 29 Apr 2018 10:08:58 GMT"
],
"Etag": [
"W/"50-1OmteF9EHlts1wNCZyvxIA""
],
"Expect-Ct": [
"max-age=604800, report-uri="
https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct""
],
"Server": [
"cloudflare"
],
"Set-Cookie": [
"__cfduid=de2207b3a95cbc631af2eb860d36289131524996538; expires=Mon,
29-Apr-19 10:08:58 GMT; path=/; domain=.paystack.co; HttpOnly",
"sails.sid=s%3A8C9sZpbqB2Csy6aMU41LhyapUfL5tNiU.eDQAaIkJfXqA6PbmC4OVhcgGiC2tjC6ALZ9NhpEpx%2FM;
Path=/; HttpOnly; Secure"
],
"Strict-Transport-Security": [
"max-age=15552000; includeSubDomains; preload"
],
"Vary": [
"X-HTTP-Method-Override"
],
"X-Content-Type-Options": [
"nosniff"
],
"X-Powered-By": [
"Sails <sailsjs.org>"
]
}
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/APG0O-doBvDPxjZz-Cx6-ACCZkofFlNaks5ttZIrgaJpZM4Tfrgv>
.
|
Hey guys! Sorry for the late response to this. UA config was in the code but noticed there was a gap in the logic in how the UA was set. The idea was to allow devs to append custom UAs to the code to further identify where the request is coming from. I have simplified it now so UA is always to set to something like |
Ah the build failed:
|
Updated the UA to use the Mozilla UA @steveamaza suggested, but the build is still failing. Won't be able to look into this again anytime soon. Happy to give access to anyone interested in helping maintain the lib. Thanks! |
Hi @steveamaza, actually, it's the transfer test that's failing. The error response from Paystack doesn't indicate why. TestTransferRecipientList (0.96s) transfer_test.go:95:
|
Sometimes, Cloudflare blocks API requests sent to Paystack servers that have no accompanying User Agent. Setting API requests with any User Agent resolves this.
My favourite UA is Chrome's (for no reason 😀 )
Mozilla/5.0 (Unknown; Linux) AppleWebKit/538.1 (KHTML, like Gecko) Chrome/v1.0.0 Safari/538.1
The text was updated successfully, but these errors were encountered: