We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
us0p
2 years agoExplorer | Level 3
/oauth2/token route is returning a binary in response
Hi, i'm having problems when deploying my integration to my QA environment, i have already tested it in development and everything was right but i'm getting a totally different response in the route ...
Greg-DB
Dropbox Staff
Thanks for the detailed post!
The 'development' versus 'production' status of your app affects how many accounts can be connected to your app but it doesn't affect the content types/encodings of the messages returned by the API.
Does your development environment have a different version or configuration of 'axios' than your QA environment? It looks like network client in the QA environment may be encoding/decoding the response differently. For instance, it seems like your client may be requesting a content-encoding like gzip, but then not decompressing the response with the gzip content-encoding and instead just showing you the compressed content.
Can you print the headers for both the request and response? That may be useful in debugging this. Be sure to redact any secret values though.
us0p
2 years agoExplorer | Level 3
Hey Greg, thanks for your reply and sorry the dalay!
I did as you suggested and printed the headers for both environments and they were pretty much the same, the only difference were in the request headers:
// Request Headers Development
AxiosHeaders {
Accept: 'application/json, text/plain, */*',
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
'Accept-Encoding': 'gzip, compress, deflate, br',
'User-Agent': 'axios/1.3.3',
'Content-Length': '240'
}
// Request Headers QA
AxiosHeaders {
Accept: 'application/json, text/plain, */*',
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
'User-Agent': 'axios/1.2.0',
'Content-Length': '199',
'Accept-Encoding': 'gzip, deflate, br'
}
// Response Headers - Dev
AxiosHeaders {
'cache-control': 'no-cache, no-store, must-revalidate',
expires: '0',
pragma: 'no-cache',
'x-content-type-options': 'nosniff',
'x-frame-options': 'SAMEORIGIN',
'x-server-response-time': '216',
'content-type': 'application/json',
'accept-encoding': 'identity,gzip',
date: 'Mon, 25 Sep 2023 18:50:34 GMT',
server: 'envoy',
vary: 'Accept-Encoding',
'x-dropbox-response-origin': 'far_remote',
'x-dropbox-request-id': '75143489d10744ea8ef2f4a1175eda99',
connection: 'close',
'transfer-encoding': 'chunked'
}
// Response Headers - QA
AxiosHeaders {
'cache-control': 'no-cache, no-store, must-revalidate',
expires: '0',
pragma: 'no-cache',
'x-content-type-options': 'nosniff',
'x-frame-options': 'SAMEORIGIN',
'x-server-response-time': '510',
'content-type': 'application/json',
'accept-encoding': 'identity,gzip',
date: 'Mon, 25 Sep 2023 14:49:36 GMT',
server: 'envoy',
vary: 'Accept-Encoding',
'x-dropbox-response-origin': 'far_remote',
'x-dropbox-request-id': '9e5db6680a4542648248855fc72ff50d',
connection: 'close',
'transfer-encoding': 'chunked'
}
So as you can see the difference is only in the Request Headers, in the Accept-Encoding and User-Agent headers, altough the version of Axios in both environments is the same, the user agent is different.
I added a Accept-Encoding header like the one i'm using in Dev, but still the same
- Greg-DB2 years agoDropbox Staff
Can you clarify what you mean when you say "altough the version of Axios in both environments is the same, the user agent is different"? The "user-agent" request header value being set by the client does seem to indicate that a different version number of Axios is being used in each case.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 12 months agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!