From 1329aa51b605cb54ba9aae3a82a0a87b881fb7b3 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 13 Nov 2017 09:09:58 -0800 Subject: Updating server dependancies. (#7816) --- vendor/gopkg.in/olivere/elastic.v5/request_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'vendor/gopkg.in/olivere/elastic.v5/request_test.go') diff --git a/vendor/gopkg.in/olivere/elastic.v5/request_test.go b/vendor/gopkg.in/olivere/elastic.v5/request_test.go index 2a2d229df..d5ae4f800 100644 --- a/vendor/gopkg.in/olivere/elastic.v5/request_test.go +++ b/vendor/gopkg.in/olivere/elastic.v5/request_test.go @@ -8,6 +8,20 @@ import "testing" var testReq *Request // used as a temporary variable to avoid compiler optimizations in tests/benchmarks +func TestRequestSetContentType(t *testing.T) { + req, err := NewRequest("GET", "/") + if err != nil { + t.Fatal(err) + } + if want, have := "application/json", req.Header.Get("Content-Type"); want != have { + t.Fatalf("want %q, have %q", want, have) + } + req.Header.Set("Content-Type", "application/x-ndjson") + if want, have := "application/x-ndjson", req.Header.Get("Content-Type"); want != have { + t.Fatalf("want %q, have %q", want, have) + } +} + func BenchmarkRequestSetBodyString(b *testing.B) { req, err := NewRequest("GET", "/") if err != nil { -- cgit v1.2.3-1-g7c22