mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-30 10:12:35 +00:00 
			
		
		
		
	Replace http method strings with net/http constants (#14677)
This commit is contained in:
		 Anton Averchenkov
					Anton Averchenkov
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							7f36a29e04
						
					
				
				
					commit
					0dd4cda7c9
				
			| @@ -3,6 +3,7 @@ package api | ||||
| import ( | ||||
| 	"context" | ||||
| 	"fmt" | ||||
| 	"net/http" | ||||
| ) | ||||
|  | ||||
| // SSH is used to return a client to invoke operations on SSH backend. | ||||
| @@ -34,7 +35,7 @@ func (c *SSH) CredentialWithContext(ctx context.Context, role string, data map[s | ||||
| 	ctx, cancelFunc := c.c.withConfiguredTimeout(ctx) | ||||
| 	defer cancelFunc() | ||||
|  | ||||
| 	r := c.c.NewRequest("PUT", fmt.Sprintf("/v1/%s/creds/%s", c.MountPoint, role)) | ||||
| 	r := c.c.NewRequest(http.MethodPut, fmt.Sprintf("/v1/%s/creds/%s", c.MountPoint, role)) | ||||
| 	if err := r.SetJSONBody(data); err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| @@ -59,7 +60,7 @@ func (c *SSH) SignKeyWithContext(ctx context.Context, role string, data map[stri | ||||
| 	ctx, cancelFunc := c.c.withConfiguredTimeout(ctx) | ||||
| 	defer cancelFunc() | ||||
|  | ||||
| 	r := c.c.NewRequest("PUT", fmt.Sprintf("/v1/%s/sign/%s", c.MountPoint, role)) | ||||
| 	r := c.c.NewRequest(http.MethodPut, fmt.Sprintf("/v1/%s/sign/%s", c.MountPoint, role)) | ||||
| 	if err := r.SetJSONBody(data); err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user