fix(lofin): Add URL encoding for filter parameter values (#290)#298
Merged
Conversation
Properly encode filter parameter values using urllib.parse.quote to handle Korean characters, spaces, and special characters in API requests. Previously unencoded values could cause malformed requests. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
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.
Summary
Closes #290
로핀(LOFIN) 어댑터의 필터 파라미터 값에 URL 인코딩을 추가하여 한글, 공백, 특수문자가 포함된 경우에도 올바른 요청을 전송하도록 수정했습니다.
Problem
src/kpubdata/providers/lofin/adapter.py약 219번째 줄에서 필터 값을 URL에 직접 문자열 결합하여 전송:한글, 공백, 특수문자가 포함된
value를 인코딩 없이 전송하면 잘못된 요청이 됩니다.Solution
표준 라이브러리
urllib.parse.quote를 사용하여 값을 URL 인코딩:key는 ASCII API 파라미터명이므로 인코딩 불필요value만quote()로 인코딩 (safe='' 옵션으로 모든 특수문자 인코딩)Quality Gate
uv run ruff check .- passeduv run ruff format --check .- passeduv run mypy src- passeduv run pytest tests/unit/providers/lofin/- 7 passeduv run pytest tests/contract/test_lofin.py- 16 passedExample
Before:
→ 잘못된 요청 (공백과 한글 미인코딩)
After:
→ 올바른 요청 (URL 인코딩 적용)