Skip to content

Commit

Permalink
(cgiserv) fix redirect_resp and err_resp (#443)
Browse files Browse the repository at this point in the history
Added a missing line break "\r\n" to HTTP redirect and error responses.
  • Loading branch information
Eronana committed Jul 29, 2021
1 parent 399eb8f commit df6a24e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mfsscripts/mfscgiserv.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ class HTTP(ClientHandler):

def redirect_resp(self,redirurl):
"""Return redirect message"""
resp_line = "%s 301 Moved Permanently\r\nLocation: %s\r\n" % (self.protocol,redirurl)
resp_line = "%s 301 Moved Permanently\r\nLocation: %s\r\n\r\n" % (self.protocol,redirurl)
if sys.version>='3':
resp_line = resp_line.encode('ascii')
self.close_when_done = True
Expand All @@ -444,7 +444,7 @@ class HTTP(ClientHandler):

def err_resp(self,code,msg):
"""Return an error message"""
resp_line = "%s %s %s\r\n" %(self.protocol,code,msg)
resp_line = "%s %s %s\r\n\r\n" %(self.protocol,code,msg)
if sys.version>='3':
resp_line = resp_line.encode('ascii')
self.close_when_done = True
Expand Down

0 comments on commit df6a24e

Please sign in to comment.