mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-11-03 23:40:03 +00:00 
			
		
		
		
	Update go-restful dependency
This commit is contained in:
		
							
								
								
									
										21
									
								
								vendor/github.com/emicklei/go-restful/container.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										21
									
								
								vendor/github.com/emicklei/go-restful/container.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -32,7 +32,7 @@ type Container struct {
 | 
			
		||||
	contentEncodingEnabled bool          // default is false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewContainer creates a new Container using a new ServeMux and default router (RouterJSR311)
 | 
			
		||||
// NewContainer creates a new Container using a new ServeMux and default router (CurlyRouter)
 | 
			
		||||
func NewContainer() *Container {
 | 
			
		||||
	return &Container{
 | 
			
		||||
		webServices:            []*WebService{},
 | 
			
		||||
@@ -74,7 +74,7 @@ func (c *Container) DoNotRecover(doNot bool) {
 | 
			
		||||
	c.doNotRecover = doNot
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Router changes the default Router (currently RouterJSR311)
 | 
			
		||||
// Router changes the default Router (currently CurlyRouter)
 | 
			
		||||
func (c *Container) Router(aRouter RouteSelector) {
 | 
			
		||||
	c.router = aRouter
 | 
			
		||||
}
 | 
			
		||||
@@ -188,6 +188,17 @@ func writeServiceError(err ServiceError, req *Request, resp *Response) {
 | 
			
		||||
	resp.WriteErrorString(err.Code, err.Message)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Dispatch the incoming Http Request to a matching WebService.
 | 
			
		||||
func (c *Container) Dispatch(httpWriter http.ResponseWriter, httpRequest *http.Request) {
 | 
			
		||||
	if httpWriter == nil {
 | 
			
		||||
		panic("httpWriter cannot be nil")
 | 
			
		||||
	}
 | 
			
		||||
	if httpRequest == nil {
 | 
			
		||||
		panic("httpRequest cannot be nil")
 | 
			
		||||
	}
 | 
			
		||||
	c.dispatch(httpWriter, httpRequest)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Dispatch the incoming Http Request to a matching WebService.
 | 
			
		||||
func (c *Container) dispatch(httpWriter http.ResponseWriter, httpRequest *http.Request) {
 | 
			
		||||
	writer := httpWriter
 | 
			
		||||
@@ -208,12 +219,6 @@ func (c *Container) dispatch(httpWriter http.ResponseWriter, httpRequest *http.R
 | 
			
		||||
			}
 | 
			
		||||
		}()
 | 
			
		||||
	}
 | 
			
		||||
	// Install closing the request body (if any)
 | 
			
		||||
	defer func() {
 | 
			
		||||
		if nil != httpRequest.Body {
 | 
			
		||||
			httpRequest.Body.Close()
 | 
			
		||||
		}
 | 
			
		||||
	}()
 | 
			
		||||
 | 
			
		||||
	// Detect if compression is needed
 | 
			
		||||
	// assume without compression, test for override
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user