Skip to content

Commit

Permalink
Don't use redirect but direct response when handling upstream API calls
Browse files Browse the repository at this point in the history
  • Loading branch information
milaq committed Aug 26, 2019
1 parent a0000ee commit 987951e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ycast/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ def upstream(path):
if 'statxml.asp' in path and request.args.get('id'):
return get_station_info()
if 'loginXML.asp' in path:
return redirect(url_for('landing', _external=True), code=302)
return landing()
logging.error("Unhandled upstream query (/setupapp/%s)", path)
abort(404)


@app.route('/', defaults={'path': ''})
@app.route('/' + PATH_ROOT + '/', defaults={'path': ''})
def landing(path):
def landing(path=''):
page = vtuner.Page()
page.add(vtuner.Directory('Radiobrowser', url_for('radiobrowser_landing', _external=True), 4))
if my_stations_enabled:
Expand Down

0 comments on commit 987951e

Please sign in to comment.