aboutsummaryrefslogtreecommitdiff
path: root/strings.go
diff options
context:
space:
mode:
authorGravatar Aliaksandr Valialkin <valyala@gmail.com> 2015-11-03 17:48:44 +0200
committerGravatar Aliaksandr Valialkin <valyala@gmail.com> 2015-11-03 17:48:44 +0200
commit0d9bc5cfde7e0fc8a4d1a76b03d9f78cfcfc876b (patch)
treedf4ffb9355952fd1edf8f728fd1e37cd4d0ab9c1 /strings.go
parentSet 'Connection: close' header for the 'one request per conn' case in server ... (diff)
downloadfasthttp-0d9bc5cfde7e0fc8a4d1a76b03d9f78cfcfc876b.tar.gz
fasthttp-0d9bc5cfde7e0fc8a4d1a76b03d9f78cfcfc876b.tar.bz2
fasthttp-0d9bc5cfde7e0fc8a4d1a76b03d9f78cfcfc876b.zip
Extracted predefined strings into a separate file
Diffstat (limited to 'strings.go')
-rw-r--r--strings.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/strings.go b/strings.go
new file mode 100644
index 0000000..1f60ad2
--- /dev/null
+++ b/strings.go
@@ -0,0 +1,36 @@
+package fasthttp
+
+var (
+ defaultServerName = []byte("fasthttp server")
+ defaultContentType = []byte("text/plain; charset=utf-8")
+)
+
+var (
+ strSlash = []byte("/")
+ strSlashSlash = []byte("//")
+ strSlashDotDot = []byte("/..")
+ strSlashDotDotSlash = []byte("/../")
+ strCRLF = []byte("\r\n")
+ strHTTP = []byte("http")
+ strHTTP11 = []byte("HTTP/1.1")
+ strColonSlashSlash = []byte("://")
+ strColonSpace = []byte(": ")
+
+ strGet = []byte("GET")
+ strHead = []byte("HEAD")
+ strPost = []byte("POST")
+
+ strConnection = []byte("Connection")
+ strContentLength = []byte("Content-Length")
+ strContentType = []byte("Content-Type")
+ strDate = []byte("Date")
+ strHost = []byte("Host")
+ strReferer = []byte("Referer")
+ strServer = []byte("Server")
+ strTransferEncoding = []byte("Transfer-Encoding")
+ strUserAgent = []byte("User-Agent")
+
+ strClose = []byte("close")
+ strChunked = []byte("chunked")
+ strPostArgsContentType = []byte("application/x-www-form-urlencoded")
+)