•  
      request #7841 Pagination headers cannot be read in CORS request
    Infos
    #7841
    Nicolas Terray (nterray)
    2015-02-05 15:32
    2015-02-04 23:13
    7847
    Details
    Pagination headers cannot be read in CORS request

    TL;DR: A javascript client cannont read our X-PAGINATION-* headers if it is not on the same domain of the requested Tuleap server.

    On non-CORS requests, all headers are available through XMLHttpRequest. However, when doing a CORS request, by default only simple response headers are readable with XMLHttpRequest (Content-Type, Last-modified, Content-Language, Cache-Control, Expires, Pragma).

    As X-PAGINATION-SIZE is obviously not part of the simple response headers list, we need to enable it by using the Access-Control-Expose-Headers:

    Access-Control-Expose-Headers: X-PAGINATION-SIZE

    This blocks people to build tools based on Tuleap REST API.

    References: 
    http://www.w3.org/TR/cors/#terminology 

    http://www.w3.org/TR/cors/#access-control-expose-headers-response-header 

    https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Access-Control-Expose-Headers

    API
    All
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Empty
    Closed
    2015-02-05
    Attachments
    References

    Follow-ups

    User avatar
    Merged in Tuleap 7.10.99.5

    • Status changed from Under review to Closed
    • Close date set to 2015-02-05
    User avatar
    • Original Submission
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes