github.com/emicklei/go-restful CWE-285: Improper Authorization
https://security.snyk.io/vuln/SNYK-GOLANG-GITHUBCOMEMICKLEIGORESTFUL-2435653 Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
This commit is contained in:
19
vendor/github.com/emicklei/go-restful/web_service.go
generated
vendored
19
vendor/github.com/emicklei/go-restful/web_service.go
generated
vendored
@@ -165,6 +165,18 @@ func FormParameter(name, description string) *Parameter {
|
||||
return p
|
||||
}
|
||||
|
||||
// MultiPartFormParameter creates a new Parameter of kind Form (using multipart/form-data) for documentation purposes.
|
||||
// It is initialized as required with string as its DataType.
|
||||
func (w *WebService) MultiPartFormParameter(name, description string) *Parameter {
|
||||
return MultiPartFormParameter(name, description)
|
||||
}
|
||||
|
||||
func MultiPartFormParameter(name, description string) *Parameter {
|
||||
p := &Parameter{&ParameterData{Name: name, Description: description, Required: false, DataType: "string"}}
|
||||
p.beMultiPartForm()
|
||||
return p
|
||||
}
|
||||
|
||||
// Route creates a new Route using the RouteBuilder and add to the ordered list of Routes.
|
||||
func (w *WebService) Route(builder *RouteBuilder) *WebService {
|
||||
w.routesLock.Lock()
|
||||
@@ -188,7 +200,7 @@ func (w *WebService) RemoveRoute(path, method string) error {
|
||||
continue
|
||||
}
|
||||
newRoutes[current] = w.routes[ix]
|
||||
current = current + 1
|
||||
current++
|
||||
}
|
||||
w.routes = newRoutes
|
||||
return nil
|
||||
@@ -288,3 +300,8 @@ func (w *WebService) PATCH(subPath string) *RouteBuilder {
|
||||
func (w *WebService) DELETE(subPath string) *RouteBuilder {
|
||||
return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("DELETE").Path(subPath)
|
||||
}
|
||||
|
||||
// OPTIONS is a shortcut for .Method("OPTIONS").Path(subPath)
|
||||
func (w *WebService) OPTIONS(subPath string) *RouteBuilder {
|
||||
return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("OPTIONS").Path(subPath)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user