browserify / browserify/http-browserify
http browserify broken when sending a full node url object
- Lingua principale
- JavaScript
- Stelle
- 245
- Fork
- 104
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
```
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.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia dalla riga 7 di index.js, dove l’URL della richiesta viene assemblata a partire dal Node URL object fornito. Riproduci l’esempio con http.get e verifica che l’URL generato sia http://localhost:8081/api/foo?bar=baz, con la porta inclusa una sola volta.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript
- Ambito
- web-dev
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 48/100