Missing carriage returns in main example in lesson
See original GitHub issueDescription: I ran into a slight hiccup in the Networking: Write a Web Browser lesson, which is part of the “Scientific Computing with Python” course and figured I’d share in case something ought to be done to ease the way for the next person.
The carriage returns are missing from the GET request in the main example in which the GET request is stored in the cmd variable at the 1:09-minute mark in the video, like so:
cmd = 'GET http://data.pr4e.org/romeo.txt HTTP/1.0\n\n'.encode()
When I copied the code on that page and tried to connect with the server, the server kept telling me I’d sent a bad command and that it didn’t understand what I wanted. After a bit of experimenting, I noticed that the example in the “Test” section at the bottom of the lesson page had some carriage returns (\r
)in front of the line feeds (\n
), like this:
cmd = 'GET http://data.pr4e.org/romeo.txt HTTP/1.0\r\n\r\n'.encode()
When I substituted that line for the one in the main example, I was able to successfully connect to the server without issue.
The carriage returns weren’t mentioned in the lesson’s video and were just in the Test section of the page. They may have been optional at the time when that video was made and just happened to be added to the test code.
It seems that the double CRLF (\r\n\r\n
) is currently how the HTTP protocol is defined by the IETF, which explains why the server was confused by my omission of them yesterday.
Perhaps a note could be added beneath the video on the lesson page letting future campers know that the carriage returns are now required.
System:
- Device: desktop
- OS: Ubuntu MATE 16.04 LTS
- Browser: Firefox
- Version: 88.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Oh, it’s a relief that the courses will still be available and that I can definitely finish all the lessons. He really is a wonderful teacher. I’m not just sort of getting it like I would with many other teachers. What Charles Severance has done is make it so I actually know things. He tops off your tanks and makes it so you walk away from each of those lessons with really solid ground beneath your feet.
The interactive curriculum sounds interesting, too, and I’ll definitely be checking that out as well when it’s released. You can never learn too much.
I’ll be learning Git properly by and by, probably once I’m done with these lessons (and/or the projects afterwards that get you the certificate). I know that GitHub offers a free tutorial you can go through.
Meanwhile, I’ll let you know if I find anything else that needs attention and would be happy to try my hand at the Git without having fully learned it with whatever instructions you provide and as long as you don’t mind if I mess it up a bit.
Thank you for reporting this issue.
This is a standard message notifying you that the issue has become stale, so we are going to close it.
If you think we’re wrong in closing this issue, please request for it to be reopened. Thank you and happy coding.