@@ -151,7 +151,7 @@ func Test_Render(t *testing.T) {
151
151
152
152
checkNil (t , err )
153
153
checkStatusOK (t , res .Code )
154
- checkContentType (t , res .HeaderMap .Get (ContentType ), ContentJSON )
154
+ checkContentType (t , res .Header () .Get (ContentType ), ContentJSON )
155
155
checkBody (t , res .Body .String (), expected )
156
156
}
157
157
@@ -172,7 +172,7 @@ func Test_String(t *testing.T) {
172
172
173
173
checkNil (t , err )
174
174
checkStatusOK (t , res .Code )
175
- checkContentType (t , res .HeaderMap .Get (ContentType ), ContentText + "; charset=" + defaultCharSet )
175
+ checkContentType (t , res .Header () .Get (ContentType ), ContentText + "; charset=" + defaultCharSet )
176
176
checkBody (t , res .Body .String (), expected )
177
177
}
178
178
@@ -234,7 +234,7 @@ func Test_JSON_prefix(t *testing.T) {
234
234
235
235
checkNil (t , err )
236
236
checkStatusOK (t , res .Code )
237
- checkContentType (t , res .HeaderMap .Get (ContentType ), ContentJSON + "; charset=" + defaultCharSet )
237
+ checkContentType (t , res .Header () .Get (ContentType ), ContentJSON + "; charset=" + defaultCharSet )
238
238
checkBody (t , res .Body .String (), expected )
239
239
}
240
240
@@ -259,7 +259,7 @@ func Test_JSONP(t *testing.T) {
259
259
260
260
checkNil (t , err )
261
261
checkStatusOK (t , res .Code )
262
- checkContentType (t , res .HeaderMap .Get (ContentType ), ContentJSONP + "; charset=" + defaultCharSet )
262
+ checkContentType (t , res .Header () .Get (ContentType ), ContentJSONP + "; charset=" + defaultCharSet )
263
263
checkBody (t , res .Body .String (), expected )
264
264
}
265
265
@@ -283,7 +283,7 @@ func Test_JSONP_without_callback(t *testing.T) {
283
283
284
284
checkNotNil (t , err )
285
285
checkStatusOK (t , res .Code )
286
- checkContentType (t , res .HeaderMap .Get (ContentType ), ContentJSONP + "; charset=" + defaultCharSet )
286
+ checkContentType (t , res .Header () .Get (ContentType ), ContentJSONP + "; charset=" + defaultCharSet )
287
287
}
288
288
289
289
func Test_XML (t * testing.T ) {
@@ -303,7 +303,7 @@ func Test_XML(t *testing.T) {
303
303
304
304
checkNil (t , err )
305
305
checkStatusOK (t , res .Code )
306
- checkContentType (t , res .HeaderMap .Get (ContentType ), ContentXML + "; charset=" + defaultCharSet )
306
+ checkContentType (t , res .Header () .Get (ContentType ), ContentXML + "; charset=" + defaultCharSet )
307
307
checkBody (t , res .Body .String (), expected )
308
308
}
309
309
@@ -329,7 +329,7 @@ func Test_XML_indent_prefix(t *testing.T) {
329
329
330
330
checkNil (t , err )
331
331
checkStatusOK (t , res .Code )
332
- checkContentType (t , res .HeaderMap .Get (ContentType ), ContentXML + "; charset=" + defaultCharSet )
332
+ checkContentType (t , res .Header () .Get (ContentType ), ContentXML + "; charset=" + defaultCharSet )
333
333
checkBody (t , res .Body .String (), expected )
334
334
}
335
335
@@ -350,7 +350,7 @@ func Test_YAML(t *testing.T) {
350
350
351
351
checkNil (t , err )
352
352
checkStatusOK (t , res .Code )
353
- checkContentType (t , res .HeaderMap .Get (ContentType ), ContentYAML + "; charset=" + defaultCharSet )
353
+ checkContentType (t , res .Header () .Get (ContentType ), ContentYAML + "; charset=" + defaultCharSet )
354
354
checkBody (t , res .Body .String (), expected )
355
355
}
356
356
@@ -371,7 +371,7 @@ func Test_HTMLString(t *testing.T) {
371
371
372
372
checkNil (t , err )
373
373
checkStatusOK (t , res .Code )
374
- checkContentType (t , res .HeaderMap .Get (ContentType ), ContentHTML + "; charset=" + defaultCharSet )
374
+ checkContentType (t , res .Header () .Get (ContentType ), ContentHTML + "; charset=" + defaultCharSet )
375
375
checkBody (t , res .Body .String (), expected )
376
376
}
377
377
@@ -406,7 +406,7 @@ func Test_HTML(t *testing.T) {
406
406
407
407
checkNil (t , err )
408
408
checkStatusOK (t , res .Code )
409
- checkContentType (t , res .HeaderMap .Get (ContentType ), ContentHTML + "; charset=" + defaultCharSet )
409
+ checkContentType (t , res .Header () .Get (ContentType ), ContentHTML + "; charset=" + defaultCharSet )
410
410
checkBody (t , res .Body .String (), expected )
411
411
}
412
412
@@ -440,7 +440,7 @@ func Test_HTML_without_name_and_debug(t *testing.T) {
440
440
441
441
checkNotNil (t , err )
442
442
checkStatusOK (t , res .Code )
443
- checkContentType (t , res .HeaderMap .Get (ContentType ), ContentHTML + "; charset=" + defaultCharSet )
443
+ checkContentType (t , res .Header () .Get (ContentType ), ContentHTML + "; charset=" + defaultCharSet )
444
444
}
445
445
446
446
func Test_HTML_invalid_name (t * testing.T ) {
@@ -473,7 +473,7 @@ func Test_HTML_invalid_name(t *testing.T) {
473
473
474
474
checkNotNil (t , err )
475
475
checkStatusOK (t , res .Code )
476
- checkContentType (t , res .HeaderMap .Get (ContentType ), ContentHTML + "; charset=" + defaultCharSet )
476
+ checkContentType (t , res .Header () .Get (ContentType ), ContentHTML + "; charset=" + defaultCharSet )
477
477
}
478
478
479
479
func Test_Template (t * testing.T ) {
@@ -510,7 +510,7 @@ func Test_Template(t *testing.T) {
510
510
511
511
checkNil (t , err )
512
512
checkStatusOK (t , res .Code )
513
- checkContentType (t , res .HeaderMap .Get (ContentType ), ContentHTML + "; charset=" + defaultCharSet )
513
+ checkContentType (t , res .Header () .Get (ContentType ), ContentHTML + "; charset=" + defaultCharSet )
514
514
checkBody (t , res .Body .String (), expected )
515
515
}
516
516
@@ -549,7 +549,7 @@ func Test_View(t *testing.T) {
549
549
550
550
checkNil (t , err )
551
551
checkStatusOK (t , res .Code )
552
- checkContentType (t , res .HeaderMap .Get (ContentType ), ContentHTML + "; charset=" + defaultCharSet )
552
+ checkContentType (t , res .Header () .Get (ContentType ), ContentHTML + "; charset=" + defaultCharSet )
553
553
checkBody (t , res .Body .String (), expected )
554
554
}
555
555
@@ -584,7 +584,7 @@ func Test_View_invalid_name(t *testing.T) {
584
584
585
585
checkNotNil (t , err )
586
586
checkStatusOK (t , res .Code )
587
- checkContentType (t , res .HeaderMap .Get (ContentType ), ContentHTML + "; charset=" + defaultCharSet )
587
+ checkContentType (t , res .Header () .Get (ContentType ), ContentHTML + "; charset=" + defaultCharSet )
588
588
}
589
589
590
590
func Test_Binary_inline (t * testing.T ) {
@@ -602,7 +602,7 @@ func Test_Binary_inline(t *testing.T) {
602
602
603
603
checkNil (t , err )
604
604
checkStatusOK (t , res .Code )
605
- checkContentType (t , res .HeaderMap .Get (ContentType ), r .opts .ContentBinary )
605
+ checkContentType (t , res .Header () .Get (ContentType ), r .opts .ContentBinary )
606
606
checkBody (t , res .Body .String (), "This is a long binary data" )
607
607
}
608
608
@@ -621,7 +621,7 @@ func Test_Binary_attachment(t *testing.T) {
621
621
622
622
checkNil (t , err )
623
623
checkStatusOK (t , res .Code )
624
- checkContentType (t , res .HeaderMap .Get (ContentType ), r .opts .ContentBinary )
624
+ checkContentType (t , res .Header () .Get (ContentType ), r .opts .ContentBinary )
625
625
checkBody (t , res .Body .String (), "This is a long binary data" )
626
626
}
627
627
@@ -675,7 +675,7 @@ func Test_File_view(t *testing.T) {
675
675
676
676
checkNil (t , err )
677
677
checkStatusOK (t , res .Code )
678
- checkContentType (t , res .HeaderMap .Get (ContentType ), r .opts .ContentText )
678
+ checkContentType (t , res .Header () .Get (ContentType ), r .opts .ContentText )
679
679
}
680
680
681
681
func Test_File_download (t * testing.T ) {
@@ -692,7 +692,7 @@ func Test_File_download(t *testing.T) {
692
692
693
693
checkNil (t , err )
694
694
checkStatusOK (t , res .Code )
695
- checkContentType (t , res .HeaderMap .Get (ContentType ), r .opts .ContentText )
695
+ checkContentType (t , res .Header () .Get (ContentType ), r .opts .ContentText )
696
696
}
697
697
698
698
func Benchmark_NoContent (b * testing.B ) {
0 commit comments