Skip to content

Commit 6d9cdd9

Browse files
committed
fix errors in instructions as noted by @codedragon
1 parent 299578f commit 6d9cdd9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

source/presentations/session02.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,19 +1194,21 @@ Quit and restart your server now that you've updated the code::
11941194
11951195
.. nextslide:: What About a Browser?
11961196

1197-
Quit and restart your server, now that you've updated the code.
1197+
The server quit during the tests, but an HTTP request from the browser should
1198+
work fine now.
11981199

11991200
.. rst-class:: build
12001201
.. container::
12011202

1202-
Reload your browser. It should work fine.
1203+
Restart the server and reload your browser. You should see your OK
1204+
response.
12031205

12041206
We can use the ``simple_client.py`` script in our resources to test our
12051207
error condition. In a second terminal window run the script like so::
12061208

12071209
$ python simple_client.py "POST / HTTP/1.0\r\n\r\n"
12081210

1209-
You'll have to quit the client pretty quickly with ``ctrl-c``
1211+
This should cause the server to crash.
12101212

12111213

12121214
Step 3: Error Responses
@@ -1296,9 +1298,9 @@ Luckily, there's an error code that is tailor-made for this situation.
12961298
def response_method_not_allowed():
12971299
"""returns a 405 Method Not Allowed response"""
12981300
resp = []
1299-
resp.append("HTTP/1.1 405 Method Not Allowed")
1300-
resp.append("")
1301-
return "\r\n".join(resp)
1301+
resp.append(b"HTTP/1.1 405 Method Not Allowed")
1302+
resp.append(b"")
1303+
return b"\r\n".join(resp)
13021304
13031305
13041306
.. nextslide:: Server Updates

0 commit comments

Comments
 (0)