summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/NYTimes/gziphandler/gzip_go18_test.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-04-16 05:37:14 -0700
committerJoram Wilander <jwawilander@gmail.com>2018-04-16 08:37:14 -0400
commit6e2cb00008cbf09e556b00f87603797fcaa47e09 (patch)
tree3c0eb55ff4226a3f024aad373140d1fb860a6404 /vendor/github.com/NYTimes/gziphandler/gzip_go18_test.go
parentbf24f51c4e1cc6286885460672f7f449e8c6f5ef (diff)
downloadchat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.gz
chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.bz2
chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.zip
Depenancy upgrades and movign to dep. (#8630)
Diffstat (limited to 'vendor/github.com/NYTimes/gziphandler/gzip_go18_test.go')
-rw-r--r--vendor/github.com/NYTimes/gziphandler/gzip_go18_test.go70
1 files changed, 0 insertions, 70 deletions
diff --git a/vendor/github.com/NYTimes/gziphandler/gzip_go18_test.go b/vendor/github.com/NYTimes/gziphandler/gzip_go18_test.go
deleted file mode 100644
index 412b2918e..000000000
--- a/vendor/github.com/NYTimes/gziphandler/gzip_go18_test.go
+++ /dev/null
@@ -1,70 +0,0 @@
-// +build go1.8
-
-package gziphandler
-
-import (
- "net/http"
- "testing"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestSetAcceptEncodingForPushOptionsWithoutHeaders(t *testing.T) {
- var opts *http.PushOptions
- opts = setAcceptEncodingForPushOptions(opts)
-
- assert.NotNil(t, opts)
- assert.NotNil(t, opts.Header)
-
- for k, v := range opts.Header {
- assert.Equal(t, "Accept-Encoding", k)
- assert.Len(t, v, 1)
- assert.Equal(t, "gzip", v[0])
- }
-
- opts = &http.PushOptions{}
- opts = setAcceptEncodingForPushOptions(opts)
-
- assert.NotNil(t, opts)
- assert.NotNil(t, opts.Header)
-
- for k, v := range opts.Header {
- assert.Equal(t, "Accept-Encoding", k)
- assert.Len(t, v, 1)
- assert.Equal(t, "gzip", v[0])
- }
-}
-
-func TestSetAcceptEncodingForPushOptionsWithHeaders(t *testing.T) {
- opts := &http.PushOptions{
- Header: http.Header{
- "User-Agent": []string{"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36"},
- },
- }
- opts = setAcceptEncodingForPushOptions(opts)
-
- assert.NotNil(t, opts)
- assert.NotNil(t, opts.Header)
-
- assert.Equal(t, "gzip", opts.Header.Get("Accept-Encoding"))
- assert.Equal(t, "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36", opts.Header.Get("User-Agent"))
-
- opts = &http.PushOptions{
- Header: http.Header{
- "User-Agent": []string{"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36"},
- acceptEncoding: []string{"deflate"},
- },
- }
- opts = setAcceptEncodingForPushOptions(opts)
-
- assert.NotNil(t, opts)
- assert.NotNil(t, opts.Header)
-
- e, found := opts.Header["Accept-Encoding"]
- if !found {
- assert.Fail(t, "Missing Accept-Encoding header value")
- }
- assert.Len(t, e, 1)
- assert.Equal(t, "deflate", e[0])
- assert.Equal(t, "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36", opts.Header.Get("User-Agent"))
-}