Repository navigation
fix(download): retry http 400 with browser user-agent - #325
Conversation
maven.egovframe.go.kr returns 400 Request Blocked for curl and wget User-Agents. The retry only continued on 403, so the jar download stopped on the first attempt.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
HTTP status retries src/fosslight_util/download.py, tests/test_download_user_agent.py |
A shared status check makes is_downloadable and download_file retry with a browser User-Agent for HTTP 400 and 403 responses. Tests check those retries and verify that HTTP 404 does not trigger one. |
System-wget User-Agent src/fosslight_util/download.py, tests/test_download_user_agent.py |
The system-wget HEAD request and command now send the browser User-Agent. The test checks both. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
- fosslight/fosslight_util#323: Adds version-level retries to the download flow; this PR changes the lower-level HTTP and system-wget attempts used by that flow.
Suggested reviewers: bjk7119
Merge Risk: 
Minimal · up to fe9d6
-
No merge-blocking risk is established from the supplied evidence.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 9 functions across 2 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Summary
maven.egovframe.go.kranswers400 Request BlockedforcurlandwgetUser-Agents and returns the jar for a browser User-Agent.wgetfallback and its Content-Length probe.Test plan
PYTHONPATH=src python -m pytest tests/test_download_user_agent.pyfosslight_download -s https://maven.egovframe.go.kr/maven/org/egovframe/rte/org.egovframe.rte.fdl.cmmn/4.1.0/org.egovframe.rte.fdl.cmmn-4.1.0.jar -t /tmp/egov-jarSummary by CodeRabbit