No announcement yet.
  • Filter
  • Time
Clear All
new posts

    Would like some help with HTMLPane and CORS

    Hi, i can't get cross-origin requests to work for a new help-site we're setting up, so hoping for some valuable input.

    We want to put all our help resources on a separate server, to be used by various clients, not just smartgwt. lets say it's on
    We want to use HTMLPane to load resources from there.
    We do not want to use the http proxy server.

    PROBLEM (all this is done on the cross-origin help-server, not my tomcat smartgwt server)
    1. First nothing worked because of missing "Access-Control-Allow-Origin: *" http header. we added that.
    2. Now it did not work because we apparently had to add "Access-Control-Allow-Methods: GET"
    3. Now it did not work because HTMLPane seems to add a "if-modified-since" http header, which was apparently not ok. We added "Access-Control-Allow-Headers: *"

    Now it gets through, but it in turn loads various additional files to server the help page which don't set those headers, which we're working on fixing.

    I can see that in the logs, there is a "pre-flight" OPTIONS request for every single of these cross-origin requests. From what i can see it's due to the "if-modified-since" parameter?
    In the Firefox logs, the initiator is just "xhr" so i guess it's the browser making the options request?

    We are in control of both these servers, is there any way to set http parameters, or configure the HTTP requests from HTMLPane so that the options call doesn't have to happen?

    I you are able to clarify this stuff for me i'd be most grateful. Cheers.