File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,6 @@ def response_method_not_allowed():
4343def response_not_found ():
4444 """Returns a 404 response Not Found """
4545
46-
4746 return b"\r \n " .join ([
4847 b"HTTP/1.1 404 Request Not Found response" ,
4948 b"" ,
@@ -95,23 +94,20 @@ def response_path(path):
9594 """
9695
9796 # path = "webroot" + path
98- # path was "/a_web_page.html"
9997 path = os .path .join ("webroot" , path .strip ('/' ))
10098
101- # now path is "webroot/a_web_page.html"
102-
103- # IF the path points to a file eg: webroot/a_web_page.html
99+ # If the path points to a file eg: webroot/a_web_page.html
104100 if os .path .isfile (path ):
105101 with open (path , "rb" ) as f :
106102 content = f .read ()
107103 mime_type = mimetypes .guess_type (path )[0 ].encode ()
108104
109- # IF the path points to a directoty eg: webroot/images
105+ # If the path points to a directoty eg: webroot/images
110106 elif os .path .isdir (path ):
111107 content = " " .join (os .listdir (path )).encode ()
112108 mime_type = b"text/plain"
113109
114- # IF the path points to a non_existing eg: webroot/asdfoo.html
110+ # If the path points to a non_existing eg: webroot/asdfoo.html
115111 else :
116112 raise NameError
117113
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ def test_root_index(self):
190190
191191 def test_ok_response_at_root_index (self ):
192192 """
193- A call to / at least yields a 200 OK response
193+ A call to / at least yields a 200 OK response
194194 """
195195
196196 directory = ''
You can’t perform that action at this time.
0 commit comments