Fix missing head request support
This commit is contained in:
parent
ef2046b610
commit
6b10ee6093
1 changed files with 2 additions and 1 deletions
|
@ -5,10 +5,11 @@ from urllib.parse import urlparse
|
|||
|
||||
app = Flask(__name__)
|
||||
|
||||
# HEAD is implicit with flask
|
||||
@app.route('/', methods=['GET', 'POST'])
|
||||
@app.route('/<shortLink>', methods=['GET', 'POST'])
|
||||
def short(shortLink=""):
|
||||
if request.method == "GET":
|
||||
if request.method == "GET" or request.method == "HEAD":
|
||||
if shortLink:
|
||||
noauto = shortLink[-1] == "+"
|
||||
if noauto: shortLink = shortLink[:-1]
|
||||
|
|
Loading…
Reference in a new issue