Skip to content

Instantly share code, notes, and snippets.

@progrium
Created January 6, 2013 00:16
Show Gist options
  • Save progrium/4464442 to your computer and use it in GitHub Desktop.
Save progrium/4464442 to your computer and use it in GitHub Desktop.
import os, urllib2
from flask import Flask, request
app = Flask(__name__)
@app.route("/")
def echo():
data = urllib2.unquote(request.query_string)
if ' ' not in data:
return data.replace('+', ' ')
else:
return data
if __name__ == "__main__":
port = int(os.environ.get('PORT', 5000))
app.run(host='0.0.0.0', port=port)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment