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

Panic on invalid url in href (contains braces) #122

Closed
xadcoh opened this issue May 14, 2019 · 2 comments
Closed

Panic on invalid url in href (contains braces) #122

xadcoh opened this issue May 14, 2019 · 2 comments
Labels

Comments

@xadcoh
Copy link

xadcoh commented May 14, 2019

Hi!

htmltest -v
htmltest 0.10.3
2019-04-24T15:54:40Z

I believe this issue related to go net/url package, but I'd like to share it with you.

If a href contains invalid url like:
<a href="(https://docs.vmware.com/en/VMware-vSphere/6.5/com.vmware.vsphere.security.doc/GUID-41E5E52E-A95B-4E81-9724-6AD6800BEF78.html)"

program will crash with:

goroutine 1 [running]:
github.com/wjdp/htmltest/output.CheckErrorPanic(0x790b20, 0xc0007d26c0)
	/home/travis/gopath/src/github.com/wjdp/htmltest/output/error.go:22 +0x86
github.com/wjdp/htmltest/htmldoc.NewReference(0xc00012de80, 0xc0009c35e0, 0xc000022300, 0x7e, 0xc0009d8748)
	/home/travis/gopath/src/github.com/wjdp/htmltest/htmldoc/reference.go:34 +0x109
github.com/wjdp/htmltest/htmltest.(*HTMLTest).checkLink(0xc0000d8d80, 0xc00012de80, 0xc0009c35e0)
	/home/travis/gopath/src/github.com/wjdp/htmltest/htmltest/check-link.go:33 +0x1a0
github.com/wjdp/htmltest/htmltest.(*HTMLTest).testDocument(0xc0000d8d80, 0xc00012de80)
	/home/travis/gopath/src/github.com/wjdp/htmltest/htmltest/htmltest.go:203 +0x193
github.com/wjdp/htmltest/htmltest.(*HTMLTest).testDocuments(0xc0000d8d80)
	/home/travis/gopath/src/github.com/wjdp/htmltest/htmltest/htmltest.go:182 +0x6a
github.com/wjdp/htmltest/htmltest.Test(0xc000011a40, 0x1, 0x1, 0x49)
	/home/travis/gopath/src/github.com/wjdp/htmltest/htmltest/htmltest.go:142 +0x8fb
main.run(0xc000011a40, 0xc000011a40)
	/home/travis/gopath/src/github.com/wjdp/htmltest/main.go:159 +0x1e8
main.main()
	/home/travis/gopath/src/github.com/wjdp/htmltest/main.go:66 +0x298
@xadcoh xadcoh changed the title Panic on invalid url in href (contains '(') Panic on invalid url in href (contains braces) May 14, 2019
@wjdp wjdp added the bug label May 23, 2019
@wjdp
Copy link
Owner

wjdp commented May 23, 2019

Thanks, will look into

wjdp added a commit that referenced this issue Jan 16, 2021
Seems fixed upstream
@wjdp
Copy link
Owner

wjdp commented Jan 16, 2021

Now returns

bad reference: "parse \"(https://docs.vmware.com/en/VMware-vSphere/6.5/com.vmware.vsphere.security.doc/GUID-41E5E52E-A95B-4E81-9724-6AD6800BEF78.html)\": first path segment in URL cannot contain colon" --- href_brackets.html --> <nil>

Seems upstream have fixed this. Unit test added.

@wjdp wjdp closed this as completed Jan 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants