form icon indicating copy to clipboard operation
form copied to clipboard

Tests are failing on Go 1.17: "invalid semicolon separator in query"

Open josephspurrier opened this issue 3 years ago • 2 comments

It looks like the tests are failing on Go 1.17 and up around parsing semicolons.

There are a couple ways to resolve - one of them is using the Go handler: https://pkg.go.dev/net/http#AllowQuerySemicolons

Other suggestions: https://golangshowcase.com/question/invalid-semicolon-separator-in-query-after-go-1-17

➜  form git:(master) ✗ go test ./...
--- FAIL: TestDecodeString (0.00s)
    decode_test.go:17: DecodeString(";C=42%2B6.6i;A.0=x;M.Bar=8;F=6.6;A.1=y;R=8734;A.2=z;Zs.0.Qp=33_44;B=true;M.Foo=7;T=2013-10-01T07:05:34.000000088Z;E.Bytes1=%00%01%02;Bytes2=%03%04%05;Zs.0.Q=11_22;Zs.0.Z=2006-12-01;M.Qux=9;life=42;S=Hello,+there.;P\\.D\\\\Q\\.B.A=P/D;P\\.D\\\\Q\\.B.B=Q-B;U=http%3A%2F%2Fexample.org%2Ffoo%23bar;"): invalid semicolon separator in query
    decode_test.go:17: DecodeString(";C=42%2B6.6i;A.0=x;M.Bar=8;F=6.6;A.1=y;R=8734;A.2=z;Zs.0.Qp=33_44;B=true;M.Foo=7;T=2013-10-01T07:05:34.000000088Z;E.Bytes1=%00%01%02;Bytes2=%03%04%05;Zs.0.Q=11_22;Zs.0.Z=2006-12-01;M.Qux=9;life=42;S=Hello,+there.;P\\.D\\\\Q\\.B.A=P/D;P\\.D\\\\Q\\.B.B=Q-B;U=http%3A%2F%2Fexample.org%2Ffoo%23bar;"): invalid semicolon separator in query
    decode_test.go:17: DecodeString(";C=42%2B6.6i;A.0=x;M.Bar=8;F=6.6;A.1=y;R=8734;A.2=z;Zs.0.Qp=33_44;B=true;M.Foo=7;T=2013-10-01T07:05:34.000000088Z;E.Bytes1=%00%01%02;Bytes2=%03%04%05;Zs.0.Q=11_22;Zs.0.Z=2006-12-01;M.Qux=9;life=42;S=Hello,+there.;P\\.D\\\\Q\\.B.A=P/D;P\\.D\\\\Q\\.B.B=Q-B;U=http%3A%2F%2Fexample.org%2Ffoo%23bar;"): invalid semicolon separator in query
--- FAIL: TestDecodeValues (0.00s)
panic: invalid semicolon separator in query [recovered]
        panic: invalid semicolon separator in query
FAIL

josephspurrier avatar Apr 18 '22 13:04 josephspurrier

@josephspurrier do you have a patch that resolves this? I also have the same exact issue while building with Go 1.23.

Ashvith10 avatar Feb 17 '25 08:02 Ashvith10

I don't have a patch, but looks like the tests could just be updated to pass: https://github.com/ajg/form/pull/26

josephspurrier avatar Feb 20 '25 15:02 josephspurrier