mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-10-27 20:14:07 +01:00
Updated #821
This commit is contained in:
@@ -294,14 +294,6 @@ func (p *ReverseProxy) ProxyHTTP(rw http.ResponseWriter, req *http.Request, rrr
|
|||||||
outreq.TransferEncoding = []string{"identity"}
|
outreq.TransferEncoding = []string{"identity"}
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := transport.RoundTrip(outreq)
|
|
||||||
if err != nil {
|
|
||||||
if p.Verbal {
|
|
||||||
p.logf("http: proxy error: %v", err)
|
|
||||||
}
|
|
||||||
return http.StatusBadGateway, err
|
|
||||||
}
|
|
||||||
|
|
||||||
//Fix for issue #821
|
//Fix for issue #821
|
||||||
if outreq.URL != nil && strings.EqualFold(outreq.URL.Scheme, "https") {
|
if outreq.URL != nil && strings.EqualFold(outreq.URL.Scheme, "https") {
|
||||||
if tr, ok := transport.(*http.Transport); ok {
|
if tr, ok := transport.(*http.Transport); ok {
|
||||||
@@ -325,6 +317,14 @@ func (p *ReverseProxy) ProxyHTTP(rw http.ResponseWriter, req *http.Request, rrr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
res, err := transport.RoundTrip(outreq)
|
||||||
|
if err != nil {
|
||||||
|
if p.Verbal {
|
||||||
|
p.logf("http: proxy error: %v", err)
|
||||||
|
}
|
||||||
|
return http.StatusBadGateway, err
|
||||||
|
}
|
||||||
|
|
||||||
// Remove hop-by-hop headers listed in the "Connection" header of the response, Remove hop-by-hop headers.
|
// Remove hop-by-hop headers listed in the "Connection" header of the response, Remove hop-by-hop headers.
|
||||||
if !rrr.NoRemoveHopByHop {
|
if !rrr.NoRemoveHopByHop {
|
||||||
removeHeaders(res.Header, rrr.NoCache)
|
removeHeaders(res.Header, rrr.NoCache)
|
||||||
|
|||||||
25
src/mod/eventsystem/event_system_doc.txt
Normal file
25
src/mod/eventsystem/event_system_doc.txt
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
package eventsystem // import "imuslab.com/zoraxy/mod/eventsystem"
|
||||||
|
|
||||||
|
|
||||||
|
VARIABLES
|
||||||
|
|
||||||
|
var (
|
||||||
|
// Publisher is the singleton instance of the event manager
|
||||||
|
Publisher *eventManager
|
||||||
|
)
|
||||||
|
|
||||||
|
FUNCTIONS
|
||||||
|
|
||||||
|
func InitEventSystem(logger *logger.Logger)
|
||||||
|
InitEventSystem initializes the event manager with the plugin manager
|
||||||
|
|
||||||
|
|
||||||
|
TYPES
|
||||||
|
|
||||||
|
type Listener interface {
|
||||||
|
Notify(event events.Event) error
|
||||||
|
GetID() ListenerID
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListenerID string
|
||||||
|
|
||||||
Reference in New Issue
Block a user