[xwiki-users] CORS and headers
Hello I am trying to use XWiki in a CORS fashion, that is, a javascript client calls pages in xwiki. This sometimes works, but I notice sometimes it doesnt. I havent found the reason why it doesnt always work. The error I get when it doesnt is: The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed. Origin 'http://localhost:8081' is therefore not allowed access. The relevant part of that error is about the multiple headers. In Chrome I can see that there are multiple same headers. Is this correct? 1. Access-Control-Allow-Origin: * 2. Access-Control-Allow-Origin: * 3. Cache-Control: no-cache 4. Content-Language: en 5. Content-Length: 765 6. Content-Script-Type: text/javascript 7. Content-Type: text/html; charset=UTF-8 8. Expires: Wed, 31 Dec 1969 23:59:59 GMT 9. Pragma: no-cache 10. Server: Jetty(9.2.3.v20140905) 11. Set-Cookie: JSESSIONID=8wg8mui7mis16hbozquntqg8;Path=/xwiki -- Anton Hughes
On Thu, Nov 26, 2015 at 4:58 PM, Anton Hughes <ah@tradeworks.io> wrote:
Hello
I am trying to use XWiki in a CORS fashion, that is, a javascript client calls pages in xwiki.
This sometimes works, but I notice sometimes it doesnt. I havent found the reason why it doesnt always work.
The error I get when it doesnt is: The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed. Origin 'http://localhost:8081' is therefore not allowed access.
The relevant part of that error is about the multiple headers.
In Chrome I can see that there are multiple same headers.
Is this correct?
I have it only once. Note that the Access-Control-Allow-Origin header is set by SetHTTPHeaderFilter as specified in your web.xml file . See https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwik... .
1. Access-Control-Allow-Origin: * 2. Access-Control-Allow-Origin: * 3. Cache-Control: no-cache 4. Content-Language: en 5. Content-Length: 765 6. Content-Script-Type: text/javascript 7. Content-Type: text/html; charset=UTF-8 8. Expires: Wed, 31 Dec 1969 23:59:59 GMT 9. Pragma: no-cache 10. Server: Jetty(9.2.3.v20140905) 11. Set-Cookie: JSESSIONID=8wg8mui7mis16hbozquntqg8;Path=/xwiki
-- Anton Hughes _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
On Fri, Nov 27, 2015 at 5:47 PM, Marius Dumitru Florea < mariusdumitru.florea@xwiki.com> wrote:
On Thu, Nov 26, 2015 at 4:58 PM, Anton Hughes <ah@tradeworks.io> wrote:
Hello
I am trying to use XWiki in a CORS fashion, that is, a javascript client calls pages in xwiki.
This sometimes works, but I notice sometimes it doesnt. I havent found the reason why it doesnt always work.
The error I get when it doesnt is: The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed. Origin 'http://localhost:8081' is therefore not allowed access.
The relevant part of that error is about the multiple headers.
In Chrome I can see that there are multiple same headers.
Is this correct?
I have it only once. Note that the Access-Control-Allow-Origin header is set by SetHTTPHeaderFilter as specified in your web.xml file . See https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwik... .
There's also this issue opened http://jira.xwiki.org/browse/XWIKI-12271 .
1. Access-Control-Allow-Origin: * 2. Access-Control-Allow-Origin: * 3. Cache-Control: no-cache 4. Content-Language: en 5. Content-Length: 765 6. Content-Script-Type: text/javascript 7. Content-Type: text/html; charset=UTF-8 8. Expires: Wed, 31 Dec 1969 23:59:59 GMT 9. Pragma: no-cache 10. Server: Jetty(9.2.3.v20140905) 11. Set-Cookie: JSESSIONID=8wg8mui7mis16hbozquntqg8;Path=/xwiki
-- Anton Hughes _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Hi Marius On 27 November 2015 at 16:47, Marius Dumitru Florea < mariusdumitru.florea@xwiki.com> wrote:
I have it only once. Note that the Access-Control-Allow-Origin header is set by SetHTTPHeaderFilter as specified in your web.xml file
Yes, I also had one when I was accessing a page on the root (not a child page). But when I accessed a child page then I had two. -- Anton Hughes
participants (2)
-
Anton Hughes -
Marius Dumitru Florea