remove dead code

This commit is contained in:
Martin Zimmermann 2013-11-08 19:03:08 +01:00
parent ab5d907172
commit a442b8e0ee
2 changed files with 1 additions and 25 deletions

View File

@ -46,11 +46,6 @@ import logging
from os.path import dirname, join from os.path import dirname, join
from argparse import ArgumentParser from argparse import ArgumentParser
try:
import httplib
except ImportError:
import http.client as httplib
import misaka import misaka
from itsdangerous import URLSafeTimedSerializer from itsdangerous import URLSafeTimedSerializer
@ -61,7 +56,7 @@ from werkzeug.wsgi import SharedDataMiddleware
from werkzeug.serving import run_simple, WSGIRequestHandler from werkzeug.serving import run_simple, WSGIRequestHandler
from werkzeug.contrib.fixers import ProxyFix from werkzeug.contrib.fixers import ProxyFix
from isso import db, migrate, views, wsgi from isso import db, migrate, wsgi
from isso.core import ThreadedMixin, uWSGIMixin, Config from isso.core import ThreadedMixin, uWSGIMixin, Config
from isso.utils import parse, http, JSONRequest from isso.utils import parse, http, JSONRequest
from isso.views import comments from isso.views import comments
@ -92,23 +87,6 @@ class Isso(object):
Rule('/check-ip', endpoint=comments.checkip) Rule('/check-ip', endpoint=comments.checkip)
]) ])
@classmethod
def CORS(cls, request, response, hosts):
for host in hosts:
if request.environ.get("HTTP_ORIGIN", None) == host.rstrip("/"):
origin = host.rstrip("/")
break
else:
origin = host.rstrip("/")
hdrs = response.headers
hdrs["Access-Control-Allow-Origin"] = origin
hdrs["Access-Control-Allow-Headers"] = "Origin, Content-Type"
hdrs["Access-Control-Allow-Credentials"] = "true"
hdrs["Access-Control-Allow-Methods"] = "GET, POST, PUT, DELETE"
return response
def __init__(self, conf): def __init__(self, conf):
self.conf = conf self.conf = conf

View File

@ -2,8 +2,6 @@
import socket import socket
from contextlib import closing
try: try:
import httplib import httplib
except ImportError: except ImportError: