1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-31 22:55:18 +00:00

[networking] Fix POST requests with zero-length payloads (#7648)

Bugfix for 227bf1a33b

Authored by: bashonly
This commit is contained in:
bashonly
2023-07-20 08:23:30 -05:00
committed by GitHub
parent 613dbce177
commit 71baa490eb
4 changed files with 14 additions and 3 deletions

View File

@@ -315,7 +315,7 @@ class HEADRequest(urllib.request.Request):
def update_Request(req, url=None, data=None, headers=None, query=None):
req_headers = req.headers.copy()
req_headers.update(headers or {})
req_data = data or req.data
req_data = data if data is not None else req.data
req_url = update_url_query(url or req.get_full_url(), query)
req_get_method = req.get_method()
if req_get_method == 'HEAD':