feat: Add http url check util function to validationUtil#6
Merged
Conversation
Member
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
klmhyeonwoo
reviewed
Aug 27, 2025
klmhyeonwoo
approved these changes
Aug 27, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new utility function checkHttpUrl to the validationUtil module for validating HTTP/HTTPS URLs. The implementation uses a two-step validation approach: first checking the protocol with a regex pattern, then using the native URL constructor for complete validation.
- Adds
checkHttpUrlfunction with regex pre-validation and URL constructor validation - Comprehensive test coverage with 16 test cases covering valid and invalid URL scenarios
- Exports the new function from the validationUtil module
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| package/validationUtil/index.ts | Exports the new checkHttpUrl function |
| package/validationUtil/checkHttpUrl/index.ts | Implements the URL validation function with regex and URL constructor |
| package/validationUtil/checkHttpUrl/index.test.ts | Comprehensive test suite with valid and invalid URL test cases |
| vitest-report.xml | Test report showing all 16 tests passing |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Description
validationUtilcheckHttpUrl유틸함수를 추가합니다.http또는https로 시작하는지 정규식으로 빠르게 1차 검사합니다.new URL())를 사용하여 URL 유효성을 검증합니다.테스트 케이스
일반적인 http/https 주소, 서브도메인, 포트 번호, 쿼리 파라미터 등을 포함하여 검증합니다.
프로토콜이 없는 경우, 상대 경로, ftp/mailto 등 다른 프로토콜, 공백 포함, 빈 문자열 등 다양한 엣지 케이스를 검증합니다.