Skip to content

Instantly share code, notes, and snippets.

View axelpale's full-sized avatar

Akseli Palén axelpale

View GitHub Profile
@axelpale
axelpale / django-crossdomainxhr-middleware.py
Created August 5, 2012 10:01 — forked from vicalejuri/django-crossdomainxhr-middleware.py
Middlware to allow's your django server to respond appropriately to cross domain XHR (postMessage html5 API).
# -*- coding: utf-8 -*-
# Source:
# https://gist.github.com/3263576
import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
from django import http
import settings