Skip to content

Commit 80cf2e8

Browse files
committed
.
1 parent c2ed300 commit 80cf2e8

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ def get_candidate_list(client_socket):
4949

5050
msg = 'GET /candidates HTTP/1.1\r\n' \
5151
f'Host: {SERVER_ADDRESS}:{SERVER_PORT}\r\n' \
52-
'Content-Length: 31\r\n' \
53-
'\r\n' \
54-
'{\r\n' \
55-
f'"key": "vote"\r\n ' \
56-
'}'
52+
# 'Content-Length: 31\r\n' \
53+
# '\r\n'
54+
# '{\r\n'
55+
# f'"key": "vote"\r\n ' \
56+
# '}'
5757

5858
client_socket.send(msg.encode())
5959

@@ -87,10 +87,10 @@ def main():
8787
# if já voltou:
8888
# get_result()
8989
# if não votou:
90+
print(get_candidate_list(client_socket))
9091
# post_vote()
9192
#get_result()
9293

93-
print(get_candidate_list(client_socket))
9494

9595
while(1):
9696
pass

src/main_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def http_get(socket_client, request):
2222
'Content-Type: text/html\r\n' \
2323
'\r\n'
2424

25-
candidates = ["1", '2'];
25+
candidates = [k for [k,v] in readjson('election').split(',')]
2626

2727
if (request['Path'] == '/'):
2828
msgBody = '<html>' \

0 commit comments

Comments
 (0)