Skip to content

Commit

Permalink
Return better HTTP error codes
Browse files Browse the repository at this point in the history
It makes more sense to use a "400: Bad Request" than a "204: No
Content" in the case that the playback fails, because the 204 indicates
there was a success, which is incorrect.
  • Loading branch information
jamietanna committed Jun 15, 2016
1 parent 8fcba89 commit faba3fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ytdl_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def do_GET(self):

data = self.match_id(yt_url)
if not data:
return self.send_response(204)
return self.send_response(400)

video_url = ''
if 'url' in data:
Expand All @@ -78,7 +78,7 @@ def do_GET(self):
if video_url_hi == '':
if video_url_lo == '':
print('Unknown format. Cannot play video from:', yt_url)
return self.send_response(204)
return self.send_response(400)
video_url = video_url_lo
else:
video_url = video_url_hi
Expand Down

0 comments on commit faba3fe

Please sign in to comment.