Skip to content

Commit

Permalink
perf: simplify multipart boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
lumina37 committed Jul 13, 2024
1 parent 4e57082 commit b4fb3b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions aiotieba/core/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import asyncio
import dataclasses as dcs
import random
import urllib.parse
from http.cookies import Morsel

Expand Down Expand Up @@ -131,7 +130,7 @@ def pack_proto_request(self, url: yarl.URL, data: bytes) -> aiohttp.ClientReques
aiohttp.ClientRequest
"""

writer = aiohttp.MultipartWriter('form-data', boundary=f"*-reverse1999-{random.randint(0, 9)}")
writer = aiohttp.MultipartWriter('form-data', boundary="-*_r1999")
payload_headers = {
aiohttp.hdrs.CONTENT_DISPOSITION: aiohttp.helpers.content_disposition_header(
'form-data', name='data', filename='file'
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "aiotieba"
version = "4.4.6a5"
version = "4.4.6"
description = "Asynchronous I/O Client for Baidu Tieba"
authors = [{ name = "Starry-OvO", email = "[email protected]" }]
urls = { Repository = "https://github.com/Starry-OvO/aiotieba/", Documentation = "https://aiotieba.cc/" }
Expand Down

0 comments on commit b4fb3b4

Please sign in to comment.