<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CORS Problem with Namespace and Dropbox-API-Path-Root header in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/CORS-Problem-with-Namespace-and-Dropbox-API-Path-Root-header/m-p/279071#M16727</link>
    <description>Thanks for the report! I'll ask the team to update our CORS implementation to allow this.</description>
    <pubDate>Tue, 05 Jun 2018 15:50:04 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2018-06-05T15:50:04Z</dc:date>
    <item>
      <title>CORS Problem with Namespace and Dropbox-API-Path-Root header</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/CORS-Problem-with-Namespace-and-Dropbox-API-Path-Root-header/m-p/279029#M16724</link>
      <description>&lt;P&gt;Trying to list team root folders using this request from the namespace guide:&lt;/P&gt;
&lt;PRE&gt;curl -X POST https://api.dropboxapi.com/2/files/list_folder \
--header "Authorization: Bearer &amp;lt;token&amp;gt;" \
--header "Content-Type: application/json" \
--header 'Dropbox-API-Path-Root: {".tag": "root", "root":"&amp;lt;namespace_id&amp;gt;"}' \
--data '{"path":""}'&lt;/PRE&gt;
&lt;P&gt;This works from the console. However, when using inside a Browser using xhr, i am running into a CORS problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Failed to load https://api.dropboxapi.com/2/files/list_folder:&lt;BR /&gt; Response to preflight request doesn't pass access control check:&lt;BR /&gt; No 'Access-Control-Allow-Origin' header is present on the requested resource.&lt;BR /&gt; Origin 'http://localhost:7331' is therefore not allowed access.&lt;BR /&gt; The response had HTTP status code 400.&lt;/PRE&gt;
&lt;P&gt;The request will work for any other folders, it seems the problem lies within the custom header (&lt;EM&gt;Dropbox-API-Path-Root&lt;/EM&gt;)&lt;/P&gt;
&lt;P&gt;Is there any way to solve this? Thank you in advance &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@FBF7D2AB59A0D6E861EBF6A36F93B7E2/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:12:53 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/CORS-Problem-with-Namespace-and-Dropbox-API-Path-Root-header/m-p/279029#M16724</guid>
      <dc:creator>AlemoDaniel</dc:creator>
      <dc:date>2019-05-29T09:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: CORS Problem with Namespace and Dropbox-API-Path-Root header</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/CORS-Problem-with-Namespace-and-Dropbox-API-Path-Root-header/m-p/279034#M16726</link>
      <description>&lt;P&gt;So i found that this works:&lt;/P&gt;
&lt;PRE&gt;curl -X POST https://api.dropboxapi.com/2/files/list_folder?path_root={".tag": "root", "root":"&amp;lt;namespace_id&amp;gt;"} \
--header "Authorization: Bearer &amp;lt;token&amp;gt;" \
--header "Content-Type: application/json" \
--data '{"path":""}'&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I didn't find this specific implementation documented anywhere, but rather derived from section&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Browser-based JavaScript and CORS pre-flight requests&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;from the &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation" target="_blank"&gt;documentation&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Use URL parameters&amp;nbsp;&lt;CODE&gt;arg&lt;/CODE&gt;&amp;nbsp;and&amp;nbsp;&lt;CODE&gt;authorization&lt;/CODE&gt;&amp;nbsp;instead of HTTP headers&amp;nbsp;&lt;CODE&gt;Dropbox-API-Arg&lt;/CODE&gt;and&amp;nbsp;&lt;CODE&gt;Authorization&lt;/CODE&gt;.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think it would still be cool, if &lt;STRONG&gt;&lt;EM&gt;Dropbox-API-Path-Root&lt;/EM&gt;&lt;/STRONG&gt; would be added to allowed headers. Currently this is the response i get:&lt;/P&gt;
&lt;PRE&gt;Access-Control-Allow-Headers: Origin, Accept-Language, Content-Language, Cache-Control,&lt;BR /&gt;     Dropbox-API-Select-User, Accept, Range, Referer, Dropbox-API-Arg, If-Modified-Since, &lt;BR /&gt;     If-None-Match, Content-Type, Dropbox-API-User-Locale, Authorization&lt;/PRE&gt;
&lt;P&gt;As you see, Dropbox-API-Arg is already supported, so there is no need to work around the preflight request&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 10:19:26 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/CORS-Problem-with-Namespace-and-Dropbox-API-Path-Root-header/m-p/279034#M16726</guid>
      <dc:creator>AlemoDaniel</dc:creator>
      <dc:date>2018-06-05T10:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: CORS Problem with Namespace and Dropbox-API-Path-Root header</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/CORS-Problem-with-Namespace-and-Dropbox-API-Path-Root-header/m-p/279071#M16727</link>
      <description>Thanks for the report! I'll ask the team to update our CORS implementation to allow this.</description>
      <pubDate>Tue, 05 Jun 2018 15:50:04 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/CORS-Problem-with-Namespace-and-Dropbox-API-Path-Root-header/m-p/279071#M16727</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-06-05T15:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: CORS Problem with Namespace and Dropbox-API-Path-Root header</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/CORS-Problem-with-Namespace-and-Dropbox-API-Path-Root-header/m-p/279153#M16732</link>
      <description>Thanks, that would be awesome. Also would be cool to have the url hacking documented a bit more detailed somewhere &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@FBF7D2AB59A0D6E861EBF6A36F93B7E2/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;</description>
      <pubDate>Wed, 06 Jun 2018 06:54:04 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/CORS-Problem-with-Namespace-and-Dropbox-API-Path-Root-header/m-p/279153#M16732</guid>
      <dc:creator>AlemoDaniel</dc:creator>
      <dc:date>2018-06-06T06:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: CORS Problem with Namespace and Dropbox-API-Path-Root header</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/CORS-Problem-with-Namespace-and-Dropbox-API-Path-Root-header/m-p/279230#M16734</link>
      <description>No problem, I'll ask the team to expand the documentation on this as well.</description>
      <pubDate>Wed, 06 Jun 2018 16:33:40 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/CORS-Problem-with-Namespace-and-Dropbox-API-Path-Root-header/m-p/279230#M16734</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-06-06T16:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: CORS Problem with Namespace and Dropbox-API-Path-Root header</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/CORS-Problem-with-Namespace-and-Dropbox-API-Path-Root-header/m-p/279430#M16766</link>
      <description>These headers have been added, so this should work now. Hope this helps!</description>
      <pubDate>Thu, 07 Jun 2018 19:56:54 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/CORS-Problem-with-Namespace-and-Dropbox-API-Path-Root-header/m-p/279430#M16766</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-06-07T19:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: CORS Problem with Namespace and Dropbox-API-Path-Root header</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/CORS-Problem-with-Namespace-and-Dropbox-API-Path-Root-header/m-p/279461#M16770</link>
      <description>Can confirm that it now works for CORS. Thanks for the quick adjustment!</description>
      <pubDate>Fri, 08 Jun 2018 06:50:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/CORS-Problem-with-Namespace-and-Dropbox-API-Path-Root-header/m-p/279461#M16770</guid>
      <dc:creator>AlemoDaniel</dc:creator>
      <dc:date>2018-06-08T06:50:14Z</dc:date>
    </item>
  </channel>
</rss>

