cmc-csci040 icon indicating copy to clipboard operation
cmc-csci040 copied to clipboard

wardialing lab instructions problem

Open louiseanne opened this issue 3 years ago • 1 comments

Hi Mike,

I believe there is a mistake in the instructions for the wardialing lab. I've been working on the last fixme for awhile and kept getting a "AttributeError: 'set' object has no attribute 'items'" error. It was happening on these two lines.

Traceback (most recent call last):
  File "/Users/louiseschiele/Documents/vscode/wardiallab/wardial.py", line 44, in <module>
    is_server_at_ip(ip)
  File "/Users/louiseschiele/Documents/vscode/wardiallab/wardial.py", line 13, in is_server_at_ip
    r = requests.get('http://'+ip, headers={'host', 'this can be anything :)'}, timeout=5)

I believe that in your step 4 of the instructions, it should be:

r = requests.get('http://'+ip, headers={'host' : 'this can be anything :)'}, timeout=5)

instead of what you have, which is:

r = requests.get('http://'+ip, headers={'host', 'this can be anything :)'}, timeout=5)

with the colon instead of the comma. I got this from this stack overflow post, where someone said that you need to use dictionaries for headers.

louiseanne avatar Dec 07 '21 19:12 louiseanne

Good detective work! You're correct that I had a typo in instructions, and your solution is also correct :)

mikeizbicki avatar Dec 08 '21 21:12 mikeizbicki