mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
Add Accept-Encoding: identity
to remaining stream paths (#2321)
## Summary Like #2319, there are a few other places where we attempt to stream a file.
This commit is contained in:
parent
a9c00024a7
commit
6866a55f20
3 changed files with 28 additions and 0 deletions
|
@ -549,6 +549,13 @@ impl RegistryClient {
|
||||||
.client
|
.client
|
||||||
.uncached()
|
.uncached()
|
||||||
.get(url.clone())
|
.get(url.clone())
|
||||||
|
.header(
|
||||||
|
// `reqwest` defaults to accepting compressed responses.
|
||||||
|
// Specify identity encoding to get consistent .whl downloading
|
||||||
|
// behavior from servers. ref: https://github.com/pypa/pip/pull/1688
|
||||||
|
"accept-encoding",
|
||||||
|
reqwest::header::HeaderValue::from_static("identity"),
|
||||||
|
)
|
||||||
.build()
|
.build()
|
||||||
.map_err(ErrorKind::from)?;
|
.map_err(ErrorKind::from)?;
|
||||||
|
|
||||||
|
|
|
@ -259,6 +259,13 @@ impl<'a, Context: BuildContext + Send + Sync> DistributionDatabase<'a, Context>
|
||||||
.cached_client()
|
.cached_client()
|
||||||
.uncached()
|
.uncached()
|
||||||
.get(wheel.url.raw().clone())
|
.get(wheel.url.raw().clone())
|
||||||
|
.header(
|
||||||
|
// `reqwest` defaults to accepting compressed responses.
|
||||||
|
// Specify identity encoding to get consistent .whl downloading
|
||||||
|
// behavior from servers. ref: https://github.com/pypa/pip/pull/1688
|
||||||
|
"accept-encoding",
|
||||||
|
reqwest::header::HeaderValue::from_static("identity"),
|
||||||
|
)
|
||||||
.build()?;
|
.build()?;
|
||||||
let cache_control = match self.client.connectivity() {
|
let cache_control = match self.client.connectivity() {
|
||||||
Connectivity::Online => CacheControl::from(
|
Connectivity::Online => CacheControl::from(
|
||||||
|
|
|
@ -307,6 +307,13 @@ impl<'a, T: BuildContext> SourceDistCachedBuilder<'a, T> {
|
||||||
.cached_client()
|
.cached_client()
|
||||||
.uncached()
|
.uncached()
|
||||||
.get(url.clone())
|
.get(url.clone())
|
||||||
|
.header(
|
||||||
|
// `reqwest` defaults to accepting compressed responses.
|
||||||
|
// Specify identity encoding to get consistent .whl downloading
|
||||||
|
// behavior from servers. ref: https://github.com/pypa/pip/pull/1688
|
||||||
|
"accept-encoding",
|
||||||
|
reqwest::header::HeaderValue::from_static("identity"),
|
||||||
|
)
|
||||||
.build()?;
|
.build()?;
|
||||||
let manifest = self
|
let manifest = self
|
||||||
.client
|
.client
|
||||||
|
@ -410,6 +417,13 @@ impl<'a, T: BuildContext> SourceDistCachedBuilder<'a, T> {
|
||||||
.cached_client()
|
.cached_client()
|
||||||
.uncached()
|
.uncached()
|
||||||
.get(url.clone())
|
.get(url.clone())
|
||||||
|
.header(
|
||||||
|
// `reqwest` defaults to accepting compressed responses.
|
||||||
|
// Specify identity encoding to get consistent .whl downloading
|
||||||
|
// behavior from servers. ref: https://github.com/pypa/pip/pull/1688
|
||||||
|
"accept-encoding",
|
||||||
|
reqwest::header::HeaderValue::from_static("identity"),
|
||||||
|
)
|
||||||
.build()?;
|
.build()?;
|
||||||
let manifest = self
|
let manifest = self
|
||||||
.client
|
.client
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue