Unexpected 502 response from Microsoft-IIS/10.0
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- swift
- Ambito
- networking
Direzione di ricerca
Inizia con il riproduttore Swift nell’issue ed eseguilo sull’URL di esempio con HTTP/2 e con http1Only abilitato. Confronta il comportamento delle richieste e delle risposte di AsyncHTTPClient con lo scambio HTTP/2 riuscito di curl; il lavoro è completato quando l’URL restituisce il 404 previsto tramite HTTP/2 senza la risposta 502.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
We are observing an unexpected 502 responses when using async http client. Using curl on the same URL results in a successful request.
Example:
curl -vs https://www.eurohome.es/ical-rent/404.html > /dev/null
* Host www.eurohome.es:443 was resolved.
* IPv6: (none)
* IPv4: 81.88.57.88
* Trying 81.88.57.88:443...
* Connected to www.eurohome.es (81.88.57.88) port 443
[... snip ...]
* SSL certificate verify ok.
* using HTTP/2
* [HTTP/2] [1] OPENED stream for https://www.eurohome.es/ical-rent/404.html
* [HTTP/2] [1] [:method: GET]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: www.eurohome.es]
* [HTTP/2] [1] [:path: /ical-rent/404.html]
* [HTTP/2] [1] [user-agent: curl/8.7.1]
* [HTTP/2] [1] [accept: */*]
> GET /ical-rent/404.html HTTP/2
> Host: www.eurohome.es
> User-Agent: curl/8.7.1
> Accept: */*
>
* Request completely sent off
< HTTP/2 404
< cache-control: private
< content-type: text/html; charset=utf-8
< server: Microsoft-IIS/10.0
< set-cookie: dadaproaffinity=7ff23aa7431c1694d43dffd9ed6cc9c9a2bc852f274fb026be889a5345c6d8d4;Path=/;Domain=www.eurohome.es
< x-powered-by: ASP.NET
< x-powered-by: ARR/3.0
< date: Thu, 05 Dec 2024 16:20:32 GMT
< content-length: 4894
<
{ [4894 bytes data]
* Connection #0 to host www.eurohome.es left intact
But running the same request through AsyncHTTPClient gives as 502 - Bad Gateway response.
swift run downloader https://www.eurohome.es/ical-rent/404.html -v
HTTPClientResponse(version: HTTP/2.0, status: 502 Bad Gateway, headers: [("content-type", "text/html"), ("server", "Microsoft-IIS/10.0"), ("date", "Thu, 05 Dec 2024 16:22:13 GMT"), ("content-length", "1477")], body: /* snip */)
The request will succeed (ie with a 404 code) when forcing http1Only on the client. Note though, that curl is able to successfully use http2.
Reproducer code
import AsyncHTTPClient
import ArgumentParser
import NIOHTTP1
import NIOCore
@main
struct Downloader: AsyncParsableCommand {
@Argument
var url: String
@Option(name: .customShort("X"))
var method: String = "GET"
@Flag(name: .short)
var verbose: Bool = false
@Flag
var http1Only: Bool = false
func run() async throws {
var config = HTTPClient.Configuration()
if http1Only {
config.httpVersion = .http1Only
}
let client = HTTPClient(configuration: config)
defer {
Task { try? await client.shutdown() }
}
var request = HTTPClientRequest(url: self.url)
request.method = HTTPMethod(rawValue: self.method)
if verbose {
print(request)
}
let response = try await client.execute(request, deadline: NIODeadline.now() + .seconds(30))
if verbose {
print(response)
}
for try await chunk in response.body {
print(String(decoding: chunk.readableBytesView, as: UTF8.self), terminator: "")
}
}
}
- Lingua principale
- Swift
- Stelle
- 1.1k
- Fork
- 159
- Merge medio
- 1h 22m
- PR unite (30g)
- 3
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di swift-server/async-http-client
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
swift-server/async-http-client#946 · 2 commenti ·
-
RequestBag keeps the request body after an early response with status >= 300Forse già presa @beshkenadze l’ha presa 11 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
-
HTTP/2 stream stays half-closed after an early response with status >= 300Forse già presa @beshkenadze l’ha presa 11 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
-
Transaction keeps the request body after an early response with status >= 300Forse già presa @beshkenadze l’ha presa 11 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
Tutte le issue di swift-server/async-http-client
Issue simili
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
manaflow-ai/cmux#32617 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
skiptools/skip-fuse-ui#166 ·
I maintainer di solito rispondono entro 2 giorni
-
Requirement is wrongAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
remko/age-plugin-se#25 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
peteromallet/desloppify#942 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno