actix / actix/actix-web

[awc] Discrepancy about default headers in code and documentation

Offen
#2,351 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
24.8k
Forks
1.9k
Ø Merge
23 Std. 10 Min.
Gemergte PRs (30 T.)
26

Beschreibung

## Expected Behavior

`awc` behavior being consistent with its API documentation.

## Current Behavior

`awc` does not set `User-Agent` header by default, despite the presence of the following method, and its documentation:
https://github.com/actix/actix-web/blob/ea8bf361041b35aa281835540f1e8aba9679aceb/awc/src/builder.rs#L119-L124
Moreover, the `default_headers` attribute does not seem to be used anywhere but in this method.

## Possible Solution

I need your opinion here, to know if the doc should be fixed, or if default `User-Agent` header should be implemented.

I would be happy to contribute on a fix.

## Steps to Reproduce (for bugs)

## Context

## Your Environment

* Rust Version (I.e, output of `rustc -V`): 1.53.0
* awc Version: 2.0.3

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.