-
Notifications
You must be signed in to change notification settings - Fork 0
[FIX] URL 입력 검증 로직 개선 #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naver.com 같은 입력을 허용했지만, 여기서 원본 trimmed를 그대로 넘기면 안전 결과 화면의 즉시 URL 접속이 Linking.openURL(url)을 bare domain으로 호출하게 됩니다. React Native의 외부 열기는 https://naver.com처럼 스킴이 있는 URL이 필요해서, 새로 허용한 입력은 검사 후 접속 액션이 실패합니다.
백엔드 전달값은 원본으로 유지하더라도, 실제 열기용 값은 보정해야 할 것 같습니다! 추후에 백엔드에서 넘어오는 값 중에 final_url 혹은 finalUrl 값이 있을텐데 그 값을 사용하면 될 것 같습니다.
그냥 인지만 하고 있어주세요!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인했습니다!
현재
add-link.tsx에서는 백엔드 전달을 고려해서 입력 원본을 유지하고 있는데, 말씀해주신 것처럼naver.com같은 bare domain은 결과 화면의Linking.openURL(url)에서 바로 열 수 없는 점 인지했습니다.추후 백엔드 연동 시
finalUrl/final_url값을 열기용 URL로 사용하거나, 실제 접속 액션에서는 스킴이 포함된 URL로 보정하는 방향으로 처리하겠습니다.