allow empty headers on DataFromReader (#2121)

This commit is contained in:
Dmitry Kutakov
2019-11-25 03:45:53 +01:00
committed by thinkerou
parent 2ee0e96394
commit b52a1a1588
3 changed files with 43 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
// Copyright 2019 Gin Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package render
import (
"net/http/httptest"
"strings"
"testing"
"github.com/stretchr/testify/require"
)
func TestReaderRenderNoHeaders(t *testing.T) {
content := "test"
r := Reader{
ContentLength: int64(len(content)),
Reader: strings.NewReader(content),
}
err := r.Render(httptest.NewRecorder())
require.NoError(t, err)
}