Blame view

middleware/main.go 626 Bytes
776b4c95b   Marko Tikvić   refactored middle...
1
2
3
4
  package middleware
  
  import (
  	"net/http"
776b4c95b   Marko Tikvić   refactored middle...
5
6
7
  )
  
  func Headers(h http.HandlerFunc) http.HandlerFunc {
65d214f47   Marko Tikvić   improved middlewa...
8
  	return SetAccessControlHeaders(IgnoreOptionsRequests(ParseForm(h)))
776b4c95b   Marko Tikvić   refactored middle...
9
  }
65d214f47   Marko Tikvić   improved middlewa...
10
11
  func AuthUser(roles string, h http.HandlerFunc) http.HandlerFunc {
  	return SetAccessControlHeaders(IgnoreOptionsRequests(ParseForm(Auth(roles, h))))
776b4c95b   Marko Tikvić   refactored middle...
12
  }
65d214f47   Marko Tikvić   improved middlewa...
13
14
  func AuthUserLogTraffic(roles string, h http.HandlerFunc) http.HandlerFunc {
  	return SetAccessControlHeaders(IgnoreOptionsRequests(ParseForm(LogHTTP(Auth(roles, h)))))
776b4c95b   Marko Tikvić   refactored middle...
15
  }
b3f1275cd   Marko Tikvić   refactored middle...
16
  func LogTraffic(h http.HandlerFunc) http.HandlerFunc {
65d214f47   Marko Tikvić   improved middlewa...
17
  	return SetAccessControlHeaders(IgnoreOptionsRequests(ParseForm(LogHTTP(h))))
776b4c95b   Marko Tikvić   refactored middle...
18
  }