Update go-restful/v3 to latest release
Signed-off-by: Phil Estes <estesp@amazon.com>
This commit is contained in:
		
							
								
								
									
										10
									
								
								vendor/github.com/emicklei/go-restful/v3/jsr311.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								vendor/github.com/emicklei/go-restful/v3/jsr311.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -151,6 +151,16 @@ func (r RouterJSR311) detectRoute(routes []Route, httpRequest *http.Request) (*R | ||||
| 		for _, candidate := range previous { | ||||
| 			available = append(available, candidate.Produces...) | ||||
| 		} | ||||
| 		// if POST,PUT,PATCH without body | ||||
| 		method, length := httpRequest.Method, httpRequest.Header.Get("Content-Length") | ||||
| 		if (method == http.MethodPost || | ||||
| 			method == http.MethodPut || | ||||
| 			method == http.MethodPatch) && length == "" { | ||||
| 			return nil, NewError( | ||||
| 				http.StatusUnsupportedMediaType, | ||||
| 				fmt.Sprintf("415: Unsupported Media Type\n\nAvailable representations: %s", strings.Join(available, ", ")), | ||||
| 			) | ||||
| 		} | ||||
| 		return nil, NewError( | ||||
| 			http.StatusNotAcceptable, | ||||
| 			fmt.Sprintf("406: Not Acceptable\n\nAvailable representations: %s", strings.Join(available, ", ")), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Phil Estes
					Phil Estes