browserify / browserify/http-browserify

Default protocol is inconsistent with Node's.

Aperta
#96 2 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
245
Fork
104
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

If not specified, http-browserify sets the protocol to `window.location.protocol`. This differs from the behavior of Node (see https://nodejs.org/api/http.html#http_http_request_options_callback ). I assume the reasoning was to make https requests if the current location is also https (but I could be wrong here).

Does it make sense to mimic Node's behavior exactly, and just default to http: ?

The issue I'm running into is when running a script locally in the browser, so the protocol is "file:". http-browserify then tries to make file:// requests, which obviously fail.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start by locating the request-option path that chooses a protocol when none is supplied, and compare its behavior with Node's http.request documentation. Reproduce the issue from a local file:// page and verify that an unspecified protocol defaults to http: rather than file:.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
api, web-dev
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.