internal: fix routing for requests with querystring signature to embedded outpost
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -201,6 +201,16 @@ func (a *Application) Mode() api.ProxyMode {
|
||||
return *a.proxyConfig.Mode.Get()
|
||||
}
|
||||
|
||||
func (a *Application) HasQuerySignature(r *http.Request) bool {
|
||||
if strings.EqualFold(r.URL.Query().Get(CallbackSignature), "true") {
|
||||
return true
|
||||
}
|
||||
if strings.EqualFold(r.URL.Query().Get(LogoutSignature), "true") {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (a *Application) ProxyConfig() api.ProxyOutpostConfig {
|
||||
return a.proxyConfig
|
||||
}
|
||||
|
@ -67,11 +67,12 @@ func NewProxyServer(ac *ak.APIController) *ProxyServer {
|
||||
|
||||
func (ps *ProxyServer) HandleHost(rw http.ResponseWriter, r *http.Request) bool {
|
||||
a, _ := ps.lookupApp(r)
|
||||
if a != nil {
|
||||
if a.Mode() == api.PROXYMODE_PROXY {
|
||||
a.ServeHTTP(rw, r)
|
||||
return true
|
||||
}
|
||||
if a == nil {
|
||||
return false
|
||||
}
|
||||
if a.HasQuerySignature(r) || a.Mode() == api.PROXYMODE_PROXY {
|
||||
a.ServeHTTP(rw, r)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
Reference in New Issue
Block a user