Beispiel #1
0
func wantsHTML(r *http.Request, m *mux.RouteMatch) bool {
	mostAccepted := common.MostAccepted(r, "text/html", "Accept")
	return mostAccepted == "text/html" || mostAccepted == "*/*"
}
Beispiel #2
0
func wantsJSON(r *http.Request, m *mux.RouteMatch) bool {
	return common.MostAccepted(r, "text/html", "Accept") == "application/json"
}