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.go
// Copyright 2010 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 ( "io" "net/http/httptrace" "net/textproto" "sort" "strings" "sync" "time" ) // A Header represents the key-value pairs in an HTTP header. // // The keys should be in canonical form, as returned by // CanonicalHeaderKey. type Header map[string][]string // Add adds the key, value pair to the header. // It appends to any existing values associated with key. // The key is case insensitive; it is canonicalized by // CanonicalHeaderKey. func (h Header) Add(key, value string) { textproto.MIMEHeader(h).Add(key, value) } // Set sets the header entries associated with key to the // single element value. It replaces any existing values // associated with key. The key is case insensitive; it is // canonicalized by textproto.CanonicalMIMEHeaderKey. // To use non-canonical keys, assign to the map directly. func (h Header) Set(key, value string) { textproto.MIMEHeader(h).Set(key, value) } // Get gets the first value associated with the given key. If // there are no values associated with the key, Get returns "". // It is case insensitive; textproto.CanonicalMIMEHeaderKey is // used to canonicalize the provided key. To use non-canonical keys, // access the map directly. func (h Header) Get(key string) string { return textproto.MIMEHeader(h).Get(key) } // Values returns all values associated with the given key. // It is case insensitive; textproto.CanonicalMIMEHeaderKey is // used to canonicalize the provided key. To use non-canonical // keys, access the map directly. // The returned slice is not a copy. func (h Header) Values(key string) []string { return textproto.MIMEHeader(h).Values(key) } // get is like Get, but key must already be in CanonicalHeaderKey form. func (h Header) get(key string) string { if v := h[key]; len(v) > 0 { return v[0] } return "" } // has reports whether h has the provided key defined, even if it's // set to 0-length slice. func (h Header) has(key string) bool { _, ok := h[key] return ok } // Del deletes the values associated with key. // The key is case insensitive; it is canonicalized by // CanonicalHeaderKey. func (h Header) Del(key string) { textproto.MIMEHeader(h).Del(key) } // Write writes a header in wire format. func (h Header) Write(w io.Writer) error { return h.write(w, nil) } func (h Header) write(w io.Writer, trace *httptrace.ClientTrace) error { return h.writeSubset(w, nil, trace) } // Clone returns a copy of h or nil if h is nil. func (h Header) Clone() Header { if h == nil { return nil } // Find total number of values. nv := 0 for _, vv := range h { nv += len(vv) } sv := make([]string, nv) // shared backing array for headers' values h2 := make(Header, len(h)) for k, vv := range h { n := copy(sv, vv) h2[k] = sv[:n:n] sv = sv[n:] } return h2 } var timeFormats = []string{ TimeFormat, time.RFC850, time.ANSIC, } // ParseTime parses a time header (such as the Date: header), // trying each of the three formats allowed by HTTP/1.1: // TimeFormat, time.RFC850, and time.ANSIC. func ParseTime(text string) (t time.Time, err error) { for _, layout := range timeFormats { t, err = time.Parse(layout, text) if err == nil { return } } return } var headerNewlineToSpace = strings.NewReplacer("\n", " ", "\r", " ") // stringWriter implements WriteString on a Writer. type stringWriter struct { w io.Writer } func (w stringWriter) WriteString(s string) (n int, err error) { return w.w.Write([]byte(s)) } type keyValues struct { key string values []string } // A headerSorter implements sort.Interface by sorting a []keyValues // by key. It's used as a pointer, so it can fit in a sort.Interface // interface value without allocation. type headerSorter struct { kvs []keyValues } func (s *headerSorter) Len() int { return len(s.kvs) } func (s *headerSorter) Swap(i, j int) { s.kvs[i], s.kvs[j] = s.kvs[j], s.kvs[i] } func (s *headerSorter) Less(i, j int) bool { return s.kvs[i].key < s.kvs[j].key } var headerSorterPool = sync.Pool{ New: func() interface{} { return new(headerSorter) }, } // sortedKeyValues returns h's keys sorted in the returned kvs // slice. The headerSorter used to sort is also returned, for possible // return to headerSorterCache. func (h Header) sortedKeyValues(exclude map[string]bool) (kvs []keyValues, hs *headerSorter) { hs = headerSorterPool.Get().(*headerSorter) if cap(hs.kvs) < len(h) { hs.kvs = make([]keyValues, 0, len(h)) } kvs = hs.kvs[:0] for k, vv := range h { if !exclude[k] { kvs = append(kvs, keyValues{k, vv}) } } hs.kvs = kvs sort.Sort(hs) return kvs, hs } // WriteSubset writes a header in wire format. // If exclude is not nil, keys where exclude[key] == true are not written. // Keys are not canonicalized before checking the exclude map. func (h Header) WriteSubset(w io.Writer, exclude map[string]bool) error { return h.writeSubset(w, exclude, nil) } func (h Header) writeSubset(w io.Writer, exclude map[string]bool, trace *httptrace.ClientTrace) error { ws, ok := w.(io.StringWriter) if !ok { ws = stringWriter{w} } kvs, sorter := h.sortedKeyValues(exclude) var formattedVals []string for _, kv := range kvs { for _, v := range kv.values { v = headerNewlineToSpace.Replace(v) v = textproto.TrimString(v) for _, s := range []string{kv.key, ": ", v, "\r\n"} { if _, err := ws.WriteString(s); err != nil { headerSorterPool.Put(sorter) return err } } if trace != nil && trace.WroteHeaderField != nil { formattedVals = append(formattedVals, v) } } if trace != nil && trace.WroteHeaderField != nil { trace.WroteHeaderField(kv.key, formattedVals) formattedVals = nil } } headerSorterPool.Put(sorter) return nil } // CanonicalHeaderKey returns the canonical format of the // header key s. The canonicalization converts the first // letter and any letter following a hyphen to upper case; // the rest are converted to lowercase. For example, the // canonical key for "accept-encoding" is "Accept-Encoding". // If s contains a space or invalid header field bytes, it is // returned without modifications. func CanonicalHeaderKey(s string) string { return textproto.CanonicalMIMEHeaderKey(s) } // hasToken reports whether token appears with v, ASCII // case-insensitive, with space or comma boundaries. // token must be all lowercase. // v may contain mixed cased. func hasToken(v, token string) bool { if len(token) > len(v) || token == "" { return false } if v == token { return true } for sp := 0; sp <= len(v)-len(token); sp++ { // Check that first character is good. // The token is ASCII, so checking only a single byte // is sufficient. We skip this potential starting // position if both the first byte and its potential // ASCII uppercase equivalent (b|0x20) don't match. // False positives ('^' => '~') are caught by EqualFold. if b := v[sp]; b != token[0] && b|0x20 != token[0] { continue } // Check that start pos is on a valid token boundary. if sp > 0 && !isTokenBoundary(v[sp-1]) { continue } // Check that end pos is on a valid token boundary. if endPos := sp + len(token); endPos != len(v) && !isTokenBoundary(v[endPos]) { continue } if strings.EqualFold(v[sp:sp+len(token)], token) { return true } } return false } func isTokenBoundary(b byte) bool { return b == ' ' || b == ',' || b == '\t' }
Close