Linux vmi284606.contaboserver.net 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.57 (Ubuntu)
: 167.86.127.34 | : 216.73.217.31
Cant Read [ /etc/named.conf ]
7.2.24-0ubuntu0.18.04.17
root
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
local /
go /
src /
net /
http /
[ HOME SHELL ]
Name
Size
Permission
Action
cgi
[ DIR ]
drwxr-xr-x
cookiejar
[ DIR ]
drwxr-xr-x
fcgi
[ DIR ]
drwxr-xr-x
httptest
[ DIR ]
drwxr-xr-x
httptrace
[ DIR ]
drwxr-xr-x
httputil
[ DIR ]
drwxr-xr-x
internal
[ DIR ]
drwxr-xr-x
pprof
[ DIR ]
drwxr-xr-x
testdata
[ DIR ]
drwxr-xr-x
alpn_test.go
3.03
KB
-rw-r--r--
client.go
31.47
KB
-rw-r--r--
client_test.go
55.36
KB
-rw-r--r--
clientserver_test.go
42.36
KB
-rw-r--r--
clone.go
1.56
KB
-rw-r--r--
cookie.go
10.76
KB
-rw-r--r--
cookie_test.go
17.74
KB
-rw-r--r--
doc.go
3.44
KB
-rw-r--r--
example_filesystem_test.go
2.03
KB
-rw-r--r--
example_handle_test.go
560
B
-rw-r--r--
example_test.go
5.28
KB
-rw-r--r--
export_test.go
7.43
KB
-rw-r--r--
filetransport.go
2.9
KB
-rw-r--r--
filetransport_test.go
1.61
KB
-rw-r--r--
fs.go
23.36
KB
-rw-r--r--
fs_test.go
35.21
KB
-rw-r--r--
h2_bundle.go
320.65
KB
-rw-r--r--
header.go
7.36
KB
-rw-r--r--
header_test.go
5.58
KB
-rw-r--r--
http.go
4.95
KB
-rw-r--r--
http_test.go
4.43
KB
-rw-r--r--
jar.go
900
B
-rw-r--r--
main_test.go
4.41
KB
-rw-r--r--
method.go
517
B
-rw-r--r--
omithttp2.go
1.85
KB
-rw-r--r--
proxy_test.go
1.13
KB
-rw-r--r--
range_test.go
2.38
KB
-rw-r--r--
readrequest_test.go
9.71
KB
-rw-r--r--
request.go
44.68
KB
-rw-r--r--
request_test.go
31.96
KB
-rw-r--r--
requestwrite_test.go
22.79
KB
-rw-r--r--
response.go
10.76
KB
-rw-r--r--
response_test.go
24.05
KB
-rw-r--r--
responsewrite_test.go
6.94
KB
-rw-r--r--
roundtrip.go
563
B
-rw-r--r--
roundtrip_js.go
9.11
KB
-rw-r--r--
serve_test.go
171.18
KB
-rw-r--r--
server.go
105.67
KB
-rw-r--r--
server_test.go
1.19
KB
-rw-r--r--
sniff.go
8
KB
-rw-r--r--
sniff_test.go
8.09
KB
-rw-r--r--
socks_bundle.go
12.93
KB
-rw-r--r--
status.go
7.26
KB
-rw-r--r--
transfer.go
30.3
KB
-rw-r--r--
transfer_test.go
7.31
KB
-rw-r--r--
transport.go
81.6
KB
-rw-r--r--
transport_internal_test.go
5.91
KB
-rw-r--r--
transport_test.go
159.07
KB
-rw-r--r--
triv.go
3.2
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : header_test.go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http import ( "bytes" "internal/race" "reflect" "runtime" "testing" "time" ) var headerWriteTests = []struct { h Header exclude map[string]bool expected string }{ {Header{}, nil, ""}, { Header{ "Content-Type": {"text/html; charset=UTF-8"}, "Content-Length": {"0"}, }, nil, "Content-Length: 0\r\nContent-Type: text/html; charset=UTF-8\r\n", }, { Header{ "Content-Length": {"0", "1", "2"}, }, nil, "Content-Length: 0\r\nContent-Length: 1\r\nContent-Length: 2\r\n", }, { Header{ "Expires": {"-1"}, "Content-Length": {"0"}, "Content-Encoding": {"gzip"}, }, map[string]bool{"Content-Length": true}, "Content-Encoding: gzip\r\nExpires: -1\r\n", }, { Header{ "Expires": {"-1"}, "Content-Length": {"0", "1", "2"}, "Content-Encoding": {"gzip"}, }, map[string]bool{"Content-Length": true}, "Content-Encoding: gzip\r\nExpires: -1\r\n", }, { Header{ "Expires": {"-1"}, "Content-Length": {"0"}, "Content-Encoding": {"gzip"}, }, map[string]bool{"Content-Length": true, "Expires": true, "Content-Encoding": true}, "", }, { Header{ "Nil": nil, "Empty": {}, "Blank": {""}, "Double-Blank": {"", ""}, }, nil, "Blank: \r\nDouble-Blank: \r\nDouble-Blank: \r\n", }, // Tests header sorting when over the insertion sort threshold side: { Header{ "k1": {"1a", "1b"}, "k2": {"2a", "2b"}, "k3": {"3a", "3b"}, "k4": {"4a", "4b"}, "k5": {"5a", "5b"}, "k6": {"6a", "6b"}, "k7": {"7a", "7b"}, "k8": {"8a", "8b"}, "k9": {"9a", "9b"}, }, map[string]bool{"k5": true}, "k1: 1a\r\nk1: 1b\r\nk2: 2a\r\nk2: 2b\r\nk3: 3a\r\nk3: 3b\r\n" + "k4: 4a\r\nk4: 4b\r\nk6: 6a\r\nk6: 6b\r\n" + "k7: 7a\r\nk7: 7b\r\nk8: 8a\r\nk8: 8b\r\nk9: 9a\r\nk9: 9b\r\n", }, } func TestHeaderWrite(t *testing.T) { var buf bytes.Buffer for i, test := range headerWriteTests { test.h.WriteSubset(&buf, test.exclude) if buf.String() != test.expected { t.Errorf("#%d:\n got: %q\nwant: %q", i, buf.String(), test.expected) } buf.Reset() } } var parseTimeTests = []struct { h Header err bool }{ {Header{"Date": {""}}, true}, {Header{"Date": {"invalid"}}, true}, {Header{"Date": {"1994-11-06T08:49:37Z00:00"}}, true}, {Header{"Date": {"Sun, 06 Nov 1994 08:49:37 GMT"}}, false}, {Header{"Date": {"Sunday, 06-Nov-94 08:49:37 GMT"}}, false}, {Header{"Date": {"Sun Nov 6 08:49:37 1994"}}, false}, } func TestParseTime(t *testing.T) { expect := time.Date(1994, 11, 6, 8, 49, 37, 0, time.UTC) for i, test := range parseTimeTests { d, err := ParseTime(test.h.Get("Date")) if err != nil { if !test.err { t.Errorf("#%d:\n got err: %v", i, err) } continue } if test.err { t.Errorf("#%d:\n should err", i) continue } if !expect.Equal(d) { t.Errorf("#%d:\n got: %v\nwant: %v", i, d, expect) } } } type hasTokenTest struct { header string token string want bool } var hasTokenTests = []hasTokenTest{ {"", "", false}, {"", "foo", false}, {"foo", "foo", true}, {"foo ", "foo", true}, {" foo", "foo", true}, {" foo ", "foo", true}, {"foo,bar", "foo", true}, {"bar,foo", "foo", true}, {"bar, foo", "foo", true}, {"bar,foo, baz", "foo", true}, {"bar, foo,baz", "foo", true}, {"bar,foo, baz", "foo", true}, {"bar, foo, baz", "foo", true}, {"FOO", "foo", true}, {"FOO ", "foo", true}, {" FOO", "foo", true}, {" FOO ", "foo", true}, {"FOO,BAR", "foo", true}, {"BAR,FOO", "foo", true}, {"BAR, FOO", "foo", true}, {"BAR,FOO, baz", "foo", true}, {"BAR, FOO,BAZ", "foo", true}, {"BAR,FOO, BAZ", "foo", true}, {"BAR, FOO, BAZ", "foo", true}, {"foobar", "foo", false}, {"barfoo ", "foo", false}, } func TestHasToken(t *testing.T) { for _, tt := range hasTokenTests { if hasToken(tt.header, tt.token) != tt.want { t.Errorf("hasToken(%q, %q) = %v; want %v", tt.header, tt.token, !tt.want, tt.want) } } } func TestNilHeaderClone(t *testing.T) { t1 := Header(nil) t2 := t1.Clone() if t2 != nil { t.Errorf("cloned header does not match original: got: %+v; want: %+v", t2, nil) } } var testHeader = Header{ "Content-Length": {"123"}, "Content-Type": {"text/plain"}, "Date": {"some date at some time Z"}, "Server": {DefaultUserAgent}, } var buf bytes.Buffer func BenchmarkHeaderWriteSubset(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { buf.Reset() testHeader.WriteSubset(&buf, nil) } } func TestHeaderWriteSubsetAllocs(t *testing.T) { if testing.Short() { t.Skip("skipping alloc test in short mode") } if race.Enabled { t.Skip("skipping test under race detector") } if runtime.GOMAXPROCS(0) > 1 { t.Skip("skipping; GOMAXPROCS>1") } n := testing.AllocsPerRun(100, func() { buf.Reset() testHeader.WriteSubset(&buf, nil) }) if n > 0 { t.Errorf("allocs = %g; want 0", n) } } // Issue 34878: test that every call to // cloneOrMakeHeader never returns a nil Header. func TestCloneOrMakeHeader(t *testing.T) { tests := []struct { name string in, want Header }{ {"nil", nil, Header{}}, {"empty", Header{}, Header{}}, { name: "non-empty", in: Header{"foo": {"bar"}}, want: Header{"foo": {"bar"}}, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { got := cloneOrMakeHeader(tt.in) if got == nil { t.Fatal("unexpected nil Header") } if !reflect.DeepEqual(got, tt.want) { t.Fatalf("Got: %#v\nWant: %#v", got, tt.want) } got.Add("A", "B") got.Get("A") }) } }
Close