getsentry/raven-js — pull request #89 by pieter (2013-03-15 16:42:38+00:00)
Title: Try to send stack trace over POST if XMLHttpRequest is available

Sending a long stack trace with a GET request can cause a lot of issues,
since many browsers / web servers limit the length of requests to a smallish
value (like 4096 bytes).

This patch checks if XMLHttpRequest is available, and if so uses that
instead of creating an image. We can send POST requests with XMLHttpRequest,
which avoids the length restrictions on GET requests.

Addresses some of the issues in #88. Doesn't address everything, since requests
in browsers without XMLHttpRequests will still silently fail.

Nice thing about this approach is there's no need for CORS headers or Sentry updates, since Sentry already supports text/plain requests with raw request data.