This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
ip_middle_octet = u"(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5]))" | |
ip_last_octet = u"(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))" | |
regex = re.compile( | |
u"^" | |
# protocol identifier | |
u"(?:(?:https?|ftp)://)" | |
# user:pass authentication |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding:utf8 | |
from flask import Flask, Response, jsonify | |
from werkzeug.exceptions import HTTPException | |
class JsonResponse(Response): | |
@classmethod | |
def force_type(cls, rv, environ=None): |
OlderNewer