browserify / browserify/http-browserify
http browserify broken when sending a full node url object
- Lenguaje dominante
- JavaScript
- Estrellas
- 245
- Forks
- 104
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
```
var url = {
host: "localhost:8081",
hostname: "localhost",
href: "http://localhost:8081/api/foo?bar=baz",
method: "GET",
path: "/api/foo?bar=baz",
pathname: "/api/foo",
port: "8081",
protocol: "http:",
query: "bar=baz",
search: "?bar=baz",
slashes: true
};
var request = http.get(url, noop);
```
```
expected: "http://localhost:8081/api/foo?bar=baz"
actual: "http://localhost:8081:8081/api/foo?bar=baz"
```
The url that is requested has the port in it 2 times. This is because of this line.
https://github.com/substack/http-browserify/blob/master/index.js#L7
I am finishing up a pull request to fix this where it will try host first, then hostname+port.
Please let me know if you have any input.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza en la línea 7 de index.js, donde se ensambla la URL de la solicitud a partir del Node URL object proporcionado. Reproduce el ejemplo con http.get y verifica que la URL generada sea http://localhost:8081/api/foo?bar=baz, con el puerto incluido solo una vez.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript
- Área
- web-dev
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 48/100