77//
88// mismatch
99//
10- // $ echo "%BOLDhw" | curl -d @- http://localhost/send
11- // 400 Bad Request
10+ // $ echo "%BOLDhw" | curl -d @- http://localhost/send
11+ // 400 Bad Request
1212//
1313// urlencoded
1414//
15- // $ echo "%BOLDhw" | curl --data-urlencode @- http://localhost/send
16- // 200 OK
15+ // $ echo "%BOLDhw" | curl --data-urlencode @- http://localhost/send
16+ // 200 OK
1717//
1818// urlencoded non-printable
1919//
20- // $ printf "\x02hw" | curl --data-urlencode @- http://localhost/send
21- // 200 OK
20+ // $ printf "\x02hw" | curl --data-urlencode @- http://localhost/send
21+ // 200 OK
2222//
2323// octetstream
2424//
25- // $ echo "%BOLDhw" | curl --data-binary @- \
26- // -H 'Content-Type: application/octet-stream' http://localhost/send
27- // 200 OK
25+ // $ echo "%BOLDhw" | curl --data-binary @- \
26+ // -H 'Content-Type: application/octet-stream' http://localhost/send
27+ // 200 OK
2828//
2929// multipart quoted-printable
3030//
31- // $ echo '%BOLDhw' | curl -F 'foo=@-;encoder=quoted-printable' \
32- // http://localhost/send
33- // 200 OK
31+ // $ echo '%BOLDhw' | curl -F 'foo=@-;encoder=quoted-printable' \
32+ // http://localhost/send
33+ // 200 OK
3434//
3535// multipart 8bit
3636//
37- // $ echo '%BOLDhw' | curl -F 'foo=@-;encoder=8bit' http://localhost/send
38- // 200 OK
37+ // $ echo '%BOLDhw' | curl -F 'foo=@-;encoder=8bit' http://localhost/send
38+ // 200 OK
3939//
4040// multipart base64
4141//
42- // $ echo '%BOLDhw' | curl -F 'foo=@-;encoder=base64' http://localhost/send
43- // 200 OK
42+ // $ echo '%BOLDhw' | curl -F 'foo=@-;encoder=base64' http://localhost/send
43+ // 200 OK
4444//
4545// The gist is that when strict mode is active, popular encodings will work
4646// while mismatches won't, even though they may still appear to at times.
47- //
4847package httplistener
4948
5049import (
@@ -72,7 +71,7 @@ func genericTestStartHTTPServer(t *testing.T, endpoint string) {
7271
7372 http .HandleFunc (endpoint , hl .genericHandler )
7473 go hl .http .ListenAndServe ()
75- t .Cleanup (func () {hl .http .Shutdown (context .Background ()); })
74+ t .Cleanup (func () { hl .http .Shutdown (context .Background ()) })
7675 time .Sleep (time .Millisecond )
7776}
7877
@@ -86,7 +85,7 @@ func genericTestSendOutput(message []byte) ([]byte, error) {
8685 return nil , err
8786 }
8887 b := make ([]byte , 1024 )
89- _ , err = io .ReadAtLeast (conn , b , 24 )
88+ _ , err = io .ReadAtLeast (conn , b , 24 )
9089 if err != nil {
9190 return nil , err
9291 }
@@ -99,7 +98,7 @@ func runGeneric(t *testing.T, reqFileName string) (string, string) {
9998 genericSender = func (_ * irc.Connection , m string , _ loggo.Logger , _ string ) {
10099 message = m
101100 }
102- t .Cleanup (func (){ genericSender = origSender })
101+ t .Cleanup (func () { genericSender = origSender })
103102
104103 src , err := os .ReadFile (path .Join ("testdata" , reqFileName ))
105104 if err != nil {
@@ -201,7 +200,7 @@ func TestGeneric(t *testing.T) {
201200 if err != nil {
202201 t .Error (err )
203202 }
204- t .Cleanup (func () {loggo .DefaultContext ().AddWriter ("default" , writer )})
203+ t .Cleanup (func () { loggo .DefaultContext ().AddWriter ("default" , writer ) })
205204 genericTestStartHTTPServer (t , "/send" )
206205
207206 t .Run ("Baseline" , testGenericBaseline )
0 commit comments