Пример #1
0
	def get(self, url):

		user = auth(session, required=not app.config['OPEN_PROXY'])

		revision = fetch.get("http://"+url, request.user_agent, user)

		if revision.bcontent and not revision.content:
			return {"response":"A wild binary."}, 200
		data = parser.parse(revision.content, 'http://' + url)
		return {"response":data}, revision.status
Пример #2
0
	def get(self, url):
		user = auth(session, required=not app.config['OPEN_PROXY'])

		revision = fetch.get("http://"+url, request.user_agent, user)
		response = Response(mimetype=revision.mimetype)

		if not "text" in revision.mimetype:
			return send_file(revision.bcontent, mimetype=revision.mimetype)
		else:
			if 'html' in revision.mimetype:
				response.data = parser.parse(revision.content, 'http://' + url)
			else:
				response.data = revision.content
		return response