@@ -118,10 +118,14 @@ "stringify me" return self.message def redirect(location, how=303): + if not location: + return location = location.replace('\r', '%0D').replace('\n', '%0A') raise HTTP(how, 'You are being redirected here' % location, Location=location) + +