3

We have built a REST Backend with Jersey 1.9.1 on Tomcat 7.0.42 using the CORS Filter from http://software.dzhuvinov.com/cors-filter.html current version 1.9.

When executing the following JS code from Chrome Version 31 or Firefox Version 26:

$.ajax({
  type: 'GET', contentType: 'application/json',
  url: 'http://tomcat.bailamos-salsa.ch/bailamossalsa/app-api/course',
  success: function(response) {
    alert(response);
  }
});

the preflight OPTIONS request returns with Code 200, but fro some devices the following GET request hangs and never returns. We tested on Windows and OSX, for some devices it worked, but for other devices it did not work with the identical browser versions.

We debugged the CORS Filter on the server but could not identify any errors.

A test case can be found here: http://jsfiddle.net/d27Zb/

Any help is very appreciated, we are desperate.

Dominik
  • 31
  • 1
  • 2
    We found out that the Antivirus Software's (Sohpos on Mac OSX) Webscanning feature prevents this CORS setup to work correctly on Chrome and Firefox. Turning this feature off fixes the problem! – Dominik Jan 07 '14 at 15:34

1 Answers1

0

For people who come across this in the future, the easiest way to debug this is to analyze the differences between systems. If you're using the same browser in multiple environments and it only works in some of them, it's probably a firewall issue. As mentioned in the comments, turning off the CORS filter for their firewall on their Mac fixed the issue.

Josh Correia
  • 3,807
  • 3
  • 33
  • 50