Rai  To
Rai To

Reputation: 25

Apache Tomcat 7 CORS Filter IE8, IE9 always return 403 response

I was trying to implement Cross-domain requesting using AJAX CORS. I enabled my server side by using CORS Filter of tomcat. But for IE8,9, tomcat always returns 403.

Are there any ideas about this question?

Upvotes: 1

Views: 842

Answers (2)

Landys
Landys

Reputation: 7727

Cors Filter here (http://software.dzhuvinov.com/cors-filter.html) is a good alternative that has no such problem.

<dependency>
    <groupId>com.thetransactioncompany</groupId>
    <artifactId>cors-filter</artifactId>
    <version>2.1.2</version>
</dependency>

Upvotes: 0

isaranchuk
isaranchuk

Reputation: 382

First of all, you should specify what request method you are using and add source code examples.


I can only guess, but if you are using POST method and default apache CorsFilter, the issue is in the following: for CORS requests IE8 and IE9 use XDomainRequest object, which doesn't appear to send any Content-Type header at all and in turn, CorsFilter considers this request as INVALID (see checkRequestType method). Possible solution is to add your own CorsFilter based on apache version that handles empty Content-Type.

Upvotes: 4

Related Questions