# -*- encoding: utf-8 -*- from __future__ import unicode_literals from functools import partial from itsdangerous import SignatureExpired, BadSignature from werkzeug.http import dump_cookie from werkzeug.wrappers import Response from werkzeug.exceptions import BadRequest, Forbidden, NotFound from isso.compat import text_type as str, string_types from isso import utils from isso.utils import JSONResponse as JSON from isso.views import requires from isso.utils.hash import sha1 from isso.controllers import threads, comments def normalize(url): if not url.startswith(("http://", "https://")): return "http://" + url return url def xhr(func): """A decorator to check for CSRF on POST/PUT/DELETE using a