jackfrued / jackfrued/Python-100-Days

64.websocket

Open
#652 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
187k
Forks
55.8k
PR merge metrics
No merged PRs in 30d

Description

class LoginHandler(tornado.web.RequestHandler):
def get(self):
self.render('login.html',hint='')
def post(self):
nickname = self.get_argument('nickname')
if nickname in nicknames:
self.render('login.html',hint='昵称已被使用,请更换昵称')
self.set_secure_cookie('nickname',nickname)
self.render('chat.html')

这里的set_secure_cookie设置后, def open(self): 中 nickname = self.get_secure_cookie('nickname').decode() ,
nickname一直是None

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the LoginHandler get and post methods shown in the issue, then trace the WebSocket handler's open method and its get_secure_cookie call. Reproduce the login-to-WebSocket flow and inspect when the secure cookie is set and read. Done means the nickname is available in open instead of resolving to None.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.