mirror of
https://github.com/umputun/reproxy.git
synced 2024-09-11 17:07:19 +03:00
This is an attempt to address #108 Instead of dedicated support of header`s removal it allows to return a flag indicating plugin's full control over headers. With this flag set, the conductor won't mix response headers with originals but rather will count on a plugin to provide all the headers.
34 lines
754 B
Go
34 lines
754 B
Go
package lib
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
// Request sent to plugins
|
|
type Request struct {
|
|
URL string
|
|
RemoteAddr string
|
|
Host string
|
|
Header http.Header
|
|
Route string // final destination
|
|
Match struct {
|
|
Server string
|
|
Src string
|
|
Dst string
|
|
ProviderID string
|
|
PingURL string
|
|
MatchType string
|
|
AssetsLocation string
|
|
AssetsWebRoot string
|
|
}
|
|
}
|
|
|
|
// Response from plugin's handler call
|
|
type Response struct {
|
|
StatusCode int
|
|
HeadersIn http.Header
|
|
HeadersOut http.Header
|
|
OverrideHeadersIn bool // indicates plugin removing all the original incoming headers
|
|
OverrideHeadersOut bool // indicates plugin removing all the original outgoing headers
|
|
}
|