middleware

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2017 License: MIT Imports: 2 Imported by: 1

Documentation

Overview

ContentType ensures that the "Content-Type" HTTP header is always "application/json" in all responses from the server.

Index

Constants

View Source
const (
	// The HTTP header that will be altered
	HttpContentTypeKey = "Content-Type"
	// The value that will go in the header
	HttpContentTypeValue = "application/json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentType

type ContentType struct {
}

ContentType Struct has no members b/c it's just a way to satisfy the interface that Negroni requires for middleware

func NewContentType

func NewContentType() *ContentType

NewContentType returns a new instance of ContentType

func (*ContentType) ServeHTTP

func (r *ContentType) ServeHTTP(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL