browserify / browserify/http-browserify

Default protocol is inconsistent with Node's.

未关闭
#96 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
245
派生
104
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先定位在未提供协议时选择协议的请求选项路径,并将其行为与 Node's http.request 文档进行比较。从本地 file:// 页面复现该问题,并验证未指定协议时默认使用 http: 而不是 file:。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
api, web-dev
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。