fix(install): install-from-source sends no User-Agent, so GitHub rejects it
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 75/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- backend-api-design, cli
Hướng nghiên cứu
Look at the install-from-source command's download logic, likely in a file handling HTTP requests. The issue mentions that since #1692, User-Agent is missing. Find where the request is made (maybe using fetch or a library like node-fetch) and ensure a default User-Agent header is added. Write a test to verify the header is present and can be overridden. Run the existing test suite with pnpm check:affected --run.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Purpose
Since #1692, app-source downloads send no User-Agent, and api.github.com answers 403 without one. Before #1692, fetch sent user-agent: node, so GitHub artifact URLs used to work.
Reproduction
This needs the workaround from #2840:
agent-device daemon stop
NODE_OPTIONS=--no-network-family-autoselection agent-device install-from-source \
https://api.github.com/repos/<owner>/<repo>/actions/artifacts/<id>/zip \
--header "authorization:Bearer $GITHUB_TOKEN" --platform android
Expected: the artifact downloads and installs.
Actual: Failed to download app source: 403.
The same thing happens with curl: curl -H 'User-Agent:' https://api.github.com/repos/callstack/agent-device returns 403, while plain curl returns 200.
Required behavior
- Requests send a
User-Agentby default. A caller can still set their own.
Completion conditions
- A test checks that a request carries the default
User-Agent, and that a caller's value replaces it. - A manual run of
install-from-sourceagainst a GitHub artifact URL succeeds. Record the command in the PR. pnpm check:affected --runis green.
Dependencies
- You can only see this on a real download once #2840 is fixed. The fix and its test don't need #2840.
- Ngôn ngữ chính
- TypeScript
- Star
- 4.7k
- Fork
- 304
- Merge trung bình
- 11 giờ 29 phút
- Pull request đã merge (30 ngày)
- 514
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của callstack/agent-device
-
docs(ios-runner): RUNNER_PROTOCOL.md points at the wrong file and omits recovery and busy codes Đang mởdocumentation good first issue ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
callstack/agent-device#2797 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
callstack/agent-device#1869 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
callstack/agent-device#2856 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
callstack/agent-device#2853 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
callstack/agent-device#2833 ·
Tất cả issue của callstack/agent-device
Issue tương tự
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Crush Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
ElementsProject/cln-application#167 · 1 bình luận · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Quantco/pnpm-licenses#17 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100