locked
Preflight (OPTIONS) issue RRS feed

  • Question

  • Hi,

    There is an issue with preflight support in documentDb Rest API. It appears that it requires authentication header for OPTIONS verb. But this preflight request is constructed by the brower and it ignores provided headers.

    Fiddler Trace :

    OPTIONS https://tenant.documents.azure.com//dbs? HTTP/1.1
    Accept: */*
    Origin: http://127.0.0.1:9000
    Access-Control-Request-Method: GET
    Access-Control-Request-Headers: cache-control, x-ms-version, x-ms-date, authorization, accept
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko
    Host: tenant.documents.azure.com
    Content-Length: 0
    DNT: 1
    Connection: Keep-Alive
    Cache-Control: no-cache
    
    
    HTTP/1.1 401 Unauthorized
    Transfer-Encoding: chunked
    Content-Type: */*
    Content-Location: https://tenant.documents.azure.com/dbs?
    Server: Microsoft-HTTPAPI/2.0
    x-ms-activity-id: dad78849-f3df-4123-857b-98a27a072915
    x-ms-gatewayversion: version=0.9.70.1
    Date: Sun, 19 Oct 2014 17:45:00 GMT
    
    7b
    {"code":"Unauthorized","message":"Required Header authorization is missing. Ensure a valid Authorization token is passed."}
    0
    
    


    Cyprien Autexier


    • Edited by sandørMVP Sunday, October 19, 2014 5:50 PM
    Sunday, October 19, 2014 5:49 PM

Answers

  • You're right that DocumentDB not currently support OPTIONS through our REST API. Please send me a note at firstName dot lastName at microsoft dot com. We'd like to understand this calling pattern through the browser better, and we can explore ways to unblock you and/or add this support.
    • Marked as answer by sandørMVP Friday, October 24, 2014 6:00 PM
    Tuesday, October 21, 2014 12:26 AM

All replies

  • You're right that DocumentDB not currently support OPTIONS through our REST API. Please send me a note at firstName dot lastName at microsoft dot com. We'd like to understand this calling pattern through the browser better, and we can explore ways to unblock you and/or add this support.
    • Marked as answer by sandørMVP Friday, October 24, 2014 6:00 PM
    Tuesday, October 21, 2014 12:26 AM
  • Hi,

    I just wrote you the email,


    Cyprien Autexier


    • Edited by sandørMVP Friday, October 24, 2014 6:01 PM
    Friday, October 24, 2014 6:01 PM
  • Is there any follow up to this?  I'm running into the same issue just trying to read a document using the javascript library.  I'm hoping I'm doing something wrong, or is the javascript library not in a state where it can be used?
    Monday, March 23, 2015 11:38 AM
  • Hi,

    I too would like an update on this please - I'm getting the same issue in Chrome.

    Thanks

    Thursday, April 30, 2015 1:17 PM
  • Is CROS supported now ?


    Is CROS supported now ?
    Wednesday, August 24, 2016 2:55 AM