Repository navigation
fix(http): send python-krex-api/<version> User-Agent by default (data.ex.co.kr WAF blocks python-httpx) - #17
Merged
Merged
Conversation
data.ex.co.kr WAF가 2026-10-08 13:35 KST 무렵부터 python-httpx/curl 기본 UA를 키·경로와 무관하게 400 Request Blocked로 막는다(KrexBadRequestError). 같은 IP에서 python-krex-api/0.1.0 UA는 통과한다. 버전은 설치된 package metadata에서 읽는다. 주입한 session은 그대로 둔다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RuoPRjkdpZNYjTZ1RYQoHj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RuoPRjkdpZNYjTZ1RYQoHj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
2026-10-08 04:35Z부터 data.ex.co.kr WAF가 흔한 HTTP 라이브러리 기본 User-Agent(
python-httpx/*,curl/*)를400 Request Blocked로 막고 있습니다. 그래서 kor-travel-transport의 highway·휴게소 유가 수집과 kor-travel-weather의krex_restarea_sync가 실패합니다.라이브러리가 직접 만드는 session이 기본으로
User-Agent: python-krex-api/<version>을 보내게 합니다. 호출자가 넘긴 session은 헤더를 포함해 그대로 씁니다.근거(n150 실측)
python-httpx/0.28.1python-krex-api/0.1.0검증
KrexBadRequestError: Request Blocked로 실패하고, 수정 후에는 통과합니다.pytest -m "not live"226 passed(기준 224), mypy·ruff 통과.🤖 Generated with Claude Code
https://claude.ai/code/session_01RuoPRjkdpZNYjTZ1RYQoHj