cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

504 when reading data

504 when reading data

johannesjo
Helpful | Level 5
Go to solution
  • Operating System and version: iOS 14.1
  • Browser Name and version: Safari 14.1

One of my users encountered a problem when using dropbox from my app from an iPhone:
https://github.com/johannesjo/super-productivity/issues/645

This is most likely the response to a request to: 

https://content.dropboxapi.com/2/files/download

 

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

Actually, I think this may be this issue: https://github.com/angular/angular/issues/37133

 

There's a solution posted there. Can you try that out?

View solution in original post

8 Replies 8

Greg-DB
Dropbox Staff
Go to solution

Would it be possible to get some sample requests/responses showing the issue so we can try to track this down and investigate on our side? Be sure to redact the access token though of course.

Greg-DB
Dropbox Staff
Go to solution

Actually, I think this may be this issue: https://github.com/angular/angular/issues/37133

 

There's a solution posted there. Can you try that out?

johannesjo
Helpful | Level 5
Go to solution

Thank you for the very quick response! Unfortunately, if I add a param to the request I get a 400 error:

`GET https://content.dropboxapi.com/2/files/download?ngsw-bypass=true 400 (Bad Request)`
And the body says:
Error in call to API function "files/download": Unexpected URL params: "ngsw-bypass"

johannesjo
Helpful | Level 5
Go to solution

Nevermind. I just figured that this is supposed to work as a header field as well. I get back to you once I've tested this.

johannesjo
Helpful | Level 5
Go to solution

Setting 

'ngsw-bypass': true

as header won't also work unfortunately as I get a Cross-origin error then... Any ideas?

Greg-DB
Dropbox Staff
Go to solution

I see, thanks. I'm not too familiar with the underlying issue here with regards to why Safari is rejecting or corrupting these requests, but looking at the proposed solution, the Dropbox API certainly doesn't expect any extra parameters or headers. (I'm not sure why this is necessary anyway since this seems like a client issue, not a server-side issue; it doesn't happen in other browsers, for instance.)

 

In any case, I don't know which specific CORS error you're getting, but the Dropbox API does offer a few other options for formatting requests that may help workaround this. You can find information on those options under "Request and response formats" in the documentation, in particular in the "Content-download endpoints" and "Browser-based JavaScript and CORS pre-flight requests" sections.

johannesjo
Helpful | Level 5
Go to solution

> (I'm not sure why this is necessary anyway since this seems like a client issue, not a server-side issue; it doesn't happen in other browsers, for instance.)

 

This is only necessary due to a long-existing bug with the angular service worker. It's a workaround to exclude requests from being cached by it. I don't see them fixing it anytime soon, that's why I am working with it in the first place.

 

Well, maybe it's time to look for an alternative solution anyway. Thank you very much for your quick and competent help! Much appreciated!

Здравко
Legendary | Level 20
Go to solution

@johannesjo wrote:

...
`GET https://content.dropboxapi.com/2/files/download?ngsw-bypass=true 400 (Bad Request)`
...


Hi @johannesjo,

Take a look on the documentation more carefully. The query must be POST, not GET!

Hope this gives direction.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Здравко Legendary | Level 20
  • User avatar
    johannesjo Helpful | Level 5
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?