browserify / browserify/http-browserify

Default protocol is inconsistent with Node's.

Đang mở
#96 2 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
245
Fork
104
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Bắt đầu bằng cách xác định đường dẫn tùy chọn request chọn một giao thức khi không có giao thức nào được cung cấp, rồi so sánh hành vi của nó với tài liệu về Node's http.request. Tái hiện vấn đề từ một trang file:// cục bộ và xác minh rằng giao thức không được chỉ định mặc định là http: thay vì file:.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript
Lĩnh vực
api, web-dev
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.