Skip to content
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

IsURL is accepting "http//" as legitimate URL prefix #494

Open
mpkondrashin opened this issue Nov 18, 2023 · 2 comments
Open

IsURL is accepting "http//" as legitimate URL prefix #494

mpkondrashin opened this issue Nov 18, 2023 · 2 comments

Comments

@mpkondrashin
Copy link

Bug Report

Summary

IsURL is accepting "http//" as legitimate URL prefix

github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2

Current behavior

govalidator.IsURL("http//abc.com") returns true.

How to reproduce

package main

import (
	"fmt"
	"github.com/asaskevich/govalidator"
)

func Main() {
	fmt.Println(govalidator.IsURL("http//abc.com"))
}

Expected behavior

IsURL is expected to return false for "http//abc.com"

@mpkondrashin mpkondrashin changed the title IsURL error IsURL is accepting "http//" as legitimate URL prefix Nov 18, 2023
@StrawHatHacker
Copy link

StrawHatHacker commented Nov 27, 2023

Just came across this error in my code. For now, I just check if it starts with http:// or https://, but it would be good if this issue is addressed soon since this package is used in a lot of production environments. Judging from the commit history, I don't have a lot of faith.

@elkcityhazard
Copy link

I submitted a pull request for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants