httpapibroker CallByHeader 함수 추가
This commit is contained in:
11
server.go
11
server.go
@ -795,6 +795,17 @@ func (hc *HttpApiBroker) AddHandler(receiver HttpApiHandler) {
|
||||
}
|
||||
}
|
||||
|
||||
func (hc *HttpApiBroker) CallByHeader(w http.ResponseWriter, r *http.Request) {
|
||||
funcname := r.Header.Get("AS-X-CALL")
|
||||
if len(funcname) == 0 {
|
||||
logger.Println("as-x-call header is missing")
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
hc.call(funcname, w, r)
|
||||
}
|
||||
|
||||
func (hc *HttpApiBroker) Call(w http.ResponseWriter, r *http.Request) {
|
||||
funcname := r.URL.Query().Get("call")
|
||||
if len(funcname) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user