Skip to content

if-modified-since header should use GMT instead of -0000 #8747

@camper42

Description

@camper42
  • command: uv lock -U uses our internal registry, backed by Tencent COS.
  • uv platform: macOS
  • uv version: uv 0.4.29 (Homebrew, 2024-10-30)

error log:

error: Failed to download `something==0.14.0`
  Caused by: Failed to fetch: `https://pypi.internal/api/package/something/something-0.14.0-py3-none-any.whl#sha256=ab3bae4f61c0ca8a72da6836610fd1256bd203420d7ec95be43afcc73512bcff`
  Caused by: HTTP status client error (400 Bad Request) for url (https://cos.tencent/our-bucket/packages/3751/something/something-0.14.0-py3-none-any.whl?Some_sig_params)

The issue is that COS reported: The If-Modified-Since you specified is not valid.

I checked the request header sent by UV, and it appears as follows: if-modified-since: Wed, 17 Jul 2024 03:39:18 -0000.

According to the MDN documentation, HTTP dates should always be expressed in GMT, not in local time.

Therefore, uv should adjust the header value to something like: if-modified-since: Wed, 17 Jul 2024 03:39:18 GMT.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions