ajbrown / angular-loggly-logger

An AngularJS module which sends your $log message to loggly, and provides a service for manually sending messages to loggly.
MIT License
32 stars 49 forks source link

CORS issue with 0.2 #43

Closed chrissimon-au closed 8 years ago

chrissimon-au commented 8 years ago

We had this issue, and found this loggly forum discussion where a few others confirmed it:

http://community.loggly.com/customer/portal/questions/16136807-posting-logs-with-cors?b_id=50

We downgraded to 0.1.3 and the problem went away.

From what I can tell, 0.1.3 used the tracking pixel method, and 0.2 uses an XHR request, so the browser initiates an OPTIONS pre-flight request with the following headers:

Access-Control-Request-Headers:accept, authorization, content-type
Access-Control-Request-Method:POST

And the loggly server rejects it with:

Request Method:OPTIONS
Status Code:405 Method Not Allowed

I assume some people are using 0.2 successfully, so just wondering if there something different we should be doing in configuration?

ajbrown commented 8 years ago

@chrissimon-au There is a fix for CORS headers pending from #41. I'll cut a release with that fix and see if that helps in 0.2.

ajbrown commented 8 years ago

@chrissimon-au I confirmed the fix in #41 solves this issue. I just cut a new release 0.2.2. Please let me know if you continue to have issues. Thanks!

chrissimon-au commented 8 years ago

Great, thanks @ajbrown - appreciate the rapid response!