Start 2025 on time and up to date. Seamlessly integrate your calendars into Dropbox with these simple steps.

Forum Discussion

Willo901's avatar
Willo901
New member | Level 1
5 days ago

Does Dropbox remove trailing slash at the end of an url?

Hi all, 

recently we've relaunched a new website: link removed
However the Authorization process in Dropbox for a specific link link removed isn't working as intended.
 
Here's how it works: 

However according to someone in our engineering team calling this url in dropbox does remove the trailing slash at the end leading of this link: link removed resulting in the process to fail. 

I'm not an expert on this so : What should we do? We recreated the site from scratch in webflow. 

We used this code on the page to enforce the trailing slash at the end:

Any help/ideas would be really appreciated 🙂

  • Willo901's avatar
    Willo901
    New member | Level 1

    Edit: Here is the javascript code

    <script>
    var url = document.location.href;
    url = url.replace(/\/?$/, '/');
    window.history.pushState('', '', url);
    </script>

    How it works: 

     

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    It looks like you're referring to the step where Dropbox redirects the user back to the URI you specify in the redirect_uri parameter you set on /oauth2/authorize

    I just checked on this, and it does not appear Dropbox itself is removing the trailing "/" from that URL. I reproduced this, and looking at the log of the network requests, I see that Dropbox is redirecting the user to the supplied redirect URL including the trailing "/", and then your server is itself returning another redirect to a URL without the trailing "/". Please see the attached screenshots:

    If you don't want the trailing "/" removed, you'll need to update your server's code to remove that behavior. That's out of our control as that would be in your code, so I can't offer help on the specifics for doing so.