瀏覽代碼

nicer uuid

master
Roderic Day 4 年之前
父節點
當前提交
315552a68b
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      pico.py

+ 1
- 1
pico.py 查看文件

@@ -52,7 +52,7 @@ class PicoProtocol(websockets.WebSocketServerProtocol):

async def process_request(self, path, request_headers):
if path == '/':
random_path = str(uuid.uuid4()).split('-')[1]
random_path = f'{uuid.uuid4()}'.replace('-', '')[:8]
return self.redirect_to(random_path)
elif path.lower() != path:
return self.redirect_to(path.lower()[1:])

Loading…
取消
儲存