HTTP/2 headers should not be included in snippets
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- typescript
- Área
- tooling
Línea de trabajo
Comienza rastreando cómo se cargan los datos HAR en los headers de la solicitud y cómo se pasan esos headers a los generadores de snippets. Reproduce la entrada HAR de ejemplo de HTTP/2 y compara la salida generada de curl; después, verifica que se excluyan los pseudo-headers como :authority y :method sin eliminar los headers ordinarios.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
It doesn't seem to be explicitly specified anywhere, but when exporting a HAR file for HTTP/2 traffic, it seems that most clients (e.g. Chrome) do include the HTTP/2 pseudo-headers in the header data. These are headers like :authority and :method.
This makes sense for HAR files, when you want an accurate recording of the full traffic details, but these shouldn't be included in HTTP snippets imo. Most clients will reject them completely, for example this curl command generated by httpsnippet will always fail, even though the original request worked fine:
curl --request GET \
--url https://google.com/ \
--header ':authority: google.com' \
--header ':method: GET' \
--header ':path: /' \
--header ':scheme: https' \
--header 'accept: */*' \
--header 'user-agent: curl/7.68.0'
These headers are basically duplicating the method & URL parts, which we include separately anyway. They're just a detail of how the method & URL are sent in HTTP/2. They also won't work because I think in every snippet here we're sending pure HTTP/1 requests, where these are generally illegal header names anyway (which I guess is why curl fails here).
I would suggest we filter these out, i.e. drop all headers starting with : when we load data from the HAR. That will never happen in HTTP/1 traffic, and in HTTP/2 traffic it's almost always redundant, and the rare cases where it's not are very weird (I think sending a request to one domain but with a :authority header for different domain is the only possible example?).
Alternatively, we could try to fully translate HTTP/2 data back into the exactly equivalent HTTP/1 requests. I wrote a blog post about that a while back here: https://httptoolkit.tech/blog/translating-http-2-into-http-1/#translating-one-to-the-other. That would just be the first HTTP/2 -> HTTP/1 list, under 'Translating one to the other', and only half are relevant, so I think it's relatively simple, but it's still more complicated than just dropping the headers, and it might plausibly have other side effects.
What do you think?
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.2k
- Forks
- 245
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Kong/httpsnippet
-
BUG: Http default clientId errorAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
Kong/httpsnippet#356 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Kong/httpsnippet#397 ·
-
v3.0.9 Bug: Can't resolve 'fs'Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Kong/httpsnippet#389 ·
-
Support for Oracle APEXAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Kong/httpsnippet#383 ·
-
Bug: R Code Generation Does Not Quote Parameters with Special Characters (e.g., `codes[]`)Posiblemente ocupada @abansal21 la tomó hace 499 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Kong/httpsnippet#379 ·
Todos los issues de Kong/httpsnippet
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
rel: fix
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Deltares/fews-web-oc#2400 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
ardia-browser/ardia#4426 ·
Los mantenedores suelen responder en 1 día
-
Bug report: isValidISODateDashOnly accepts text before or after the date-timePosiblemente ocupada @bardrop la tomó hoy. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
pnp/cli-microsoft365#7713 ·
Los mantenedores suelen responder en 1 día
-
Diagram: Journey Type: Bug / Error
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
mermaid-js/mermaid-v13#1293 ·
Los mantenedores suelen responder en 1 día