Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix: add custom URL validation to ShortenURL function #4

Merged
merged 2 commits into from
Dec 30, 2024

Conversation

kek-Sec
Copy link
Owner

@kek-Sec kek-Sec commented Dec 30, 2024

This pull request includes , focusing on improving URL validation and handling custom URLs. The most important changes include switching the package declaration, adding a new function for custom URL validation, and modifying the URL shortening logic to incorporate this validation.

Improvements to URL validation and handling:

  • internal/api/v1/shorten.go: Added the validateCustomURL function to ensure custom URLs do not contain spaces or illegal characters.
  • internal/api/v1/shorten.go: Modified the ShortenURL function to use the validateCustomURL function and handle invalid custom URLs by returning a BadRequest status.

@kek-Sec kek-Sec merged commit 3268281 into main Dec 30, 2024
11 checks passed
@kek-Sec kek-Sec deleted the fix/validate-custom-url branch December 30, 2024 10:01
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant