Skip to content

Commit

Permalink
Fixed alias without redirection for .js (#17 #35)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinMikita committed Sep 9, 2016
1 parent 655f780 commit 7f5414d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions web/websearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,9 +604,7 @@ def has_modified_header(headers):
Autocomplete searching via HTTP URL
"""
@app.route('/q/<query>', defaults={'country_code': None})
@app.route('/q/<query>.js', defaults={'country_code': None})
@app.route('/<country_code>/q/<query>')
@app.route('/<country_code>/q/<query>.js')
def search_url(country_code, query):
autocomplete = True
code = 400
Expand Down Expand Up @@ -634,6 +632,13 @@ def search_url(country_code, query):
return formatResponse(data, code)


# Alias without redirect
@app.route('/q/<query>.js', defaults={'country_code': None})
@app.route('/<country_code>/q/<query>.js')
def search_url_js(country_code, query):
return search_url(country_code, query)



# ---------------------------------------------------------
"""
Expand Down

0 comments on commit 7f5414d

Please sign in to comment.