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 unconventional fractional links #101

Open
kaushalmodi opened this issue Sep 15, 2018 · 2 comments
Open

Panic on unconventional fractional links #101

kaushalmodi opened this issue Sep 15, 2018 · 2 comments
Labels

Comments

@kaushalmodi
Copy link

kaushalmodi commented Sep 15, 2018

Hello,

You can find the panic log here: https://travis-ci.org/kaushalmodi/nim-nightly-docs/builds/428903236#L608

panic: parse #+%,IntMax32,IntMax32: invalid URL escape "%,I"
goroutine 1 [running]:
github.com/wjdp/htmltest/output.CheckErrorPanic(0x787340, 0xc001984cc0)
	/home/kmodi/go.apps/src/github.com/wjdp/htmltest/output/error.go:22 +0x86
github.com/wjdp/htmltest/htmldoc.NewReference(0xc0000f6f00, 0xc000cf1260, 0xc000ce88e0, 0x15, 0xc001987ca8)
	/home/kmodi/go.apps/src/github.com/wjdp/htmltest/htmldoc/reference.go:34 +0x109
github.com/wjdp/htmltest/htmltest.(*HTMLTest).checkLink(0xc0000b8b40, 0xc0000f6f00, 0xc000cf1260)
	/home/kmodi/go.apps/src/github.com/wjdp/htmltest/htmltest/check-link.go:33 +0x1a0
github.com/wjdp/htmltest/htmltest.(*HTMLTest).testDocument(0xc0000b8b40, 0xc0000f6f00)
	/home/kmodi/go.apps/src/github.com/wjdp/htmltest/htmltest/htmltest.go:203 +0x193
github.com/wjdp/htmltest/htmltest.(*HTMLTest).testDocuments(0xc0000b8b40)
	/home/kmodi/go.apps/src/github.com/wjdp/htmltest/htmltest/htmltest.go:182 +0x6a
github.com/wjdp/htmltest/htmltest.Test(0xc0000659e0, 0x1, 0x1, 0x49)
	/home/kmodi/go.apps/src/github.com/wjdp/htmltest/htmltest/htmltest.go:142 +0x8fb
main.run(0xc0000659e0, 0xc0000659e0)
	/home/kmodi/go.apps/src/github.com/wjdp/htmltest/main.go:159 +0x1e8
main.main()
	/home/kmodi/go.apps/src/github.com/wjdp/htmltest/mai

It panics when it comes across this link: https://kaushalmodi.github.io/nim-nightly-docs/system.html#+%,IntMax32,IntMax32

When testing, you may also ensure that these links don't cause panic too:

(That whole page might serve as a good test case.)

wjdp added a commit that referenced this issue Sep 15, 2018
@wjdp
Copy link
Owner

wjdp commented Sep 15, 2018

Popped these links in a test case they do indeed cause a problem.

=== RUN   TestIssue101
--- FAIL: TestIssue101 (0.00s)
panic: parse https://kaushalmodi.github.io/nim-nightly-docs/system.html#+%,IntMax32,IntMax32: invalid URL escape "%,I" [recovered]
	panic: parse https://kaushalmodi.github.io/nim-nightly-docs/system.html#+%,IntMax32,IntMax32: invalid URL escape "%,I"

goroutine 248 [running]:
testing.tRunner.func1(0xc0004f2600)
	/usr/local/go/src/testing/testing.go:792 +0x387
panic(0x6d47e0, 0xc0014f4150)
	/usr/local/go/src/runtime/panic.go:513 +0x1b9
github.com/wjdp/htmltest/output.CheckErrorPanic(0x79da20, 0xc0014e2b40)
	/home/will/local/htmltest/output/error.go:22 +0x86
github.com/wjdp/htmltest/htmldoc.NewReference(0xc0014dcc80, 0xc0014e8930, 0xc000e4a230, 0x4f, 0xc0014f2868)
	/home/will/local/htmltest/htmldoc/reference.go:34 +0x109
github.com/wjdp/htmltest/htmltest.(*HTMLTest).checkLink(0xc0014c9d40, 0xc0014dcc80, 0xc0014e8930)
	/home/will/local/htmltest/htmltest/check-link.go:33 +0x1a0
github.com/wjdp/htmltest/htmltest.(*HTMLTest).testDocument(0xc0014c9d40, 0xc0014dcc80)
	/home/will/local/htmltest/htmltest/htmltest.go:203 +0x193
github.com/wjdp/htmltest/htmltest.Test(0xc0014e27e0, 0x1e, 0xc0014e27e0, 0x4dc5128f42af)
	/home/will/local/htmltest/htmltest/htmltest.go:139 +0x948
github.com/wjdp/htmltest/htmltest.tTestFile(0x751824, 0x1e, 0x5b9d86b7)
	/home/will/local/htmltest/htmltest/test_helpers_test.go:51 +0x43
github.com/wjdp/htmltest/htmltest.TestIssue101(0xc0004f2600)
	/home/will/local/htmltest/htmltest/check-link_test.go:624 +0x36
testing.tRunner(0xc0004f2600, 0x761610)
	/usr/local/go/src/testing/testing.go:827 +0xbf
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:878 +0x353
FAIL	github.com/wjdp/htmltest/htmltest	4.810s

@wjdp wjdp added the bug label Sep 15, 2018
@wjdp
Copy link
Owner

wjdp commented Sep 15, 2018

Digging into this: this error is from golang's net/url package. It's upset about the use of percent encoding in the URL. This works in the browser but is likely incorrect per spec (in this case an RFC).

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