mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-31 02:28:09 +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
				
			| @@ -1,6 +1,9 @@ | ||||
| package api | ||||
|  | ||||
| import "context" | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net/http" | ||||
| ) | ||||
|  | ||||
| func (c *Sys) GenerateRootStatus() (*GenerateRootStatusResponse, error) { | ||||
| 	return c.GenerateRootStatusWithContext(context.Background()) | ||||
| @@ -30,7 +33,7 @@ func (c *Sys) generateRootStatusCommonWithContext(ctx context.Context, path stri | ||||
| 	ctx, cancelFunc := c.c.withConfiguredTimeout(ctx) | ||||
| 	defer cancelFunc() | ||||
|  | ||||
| 	r := c.c.NewRequest("GET", path) | ||||
| 	r := c.c.NewRequest(http.MethodGet, path) | ||||
|  | ||||
| 	resp, err := c.c.rawRequestWithContext(ctx, r) | ||||
| 	if err != nil { | ||||
| @@ -76,7 +79,7 @@ func (c *Sys) generateRootInitCommonWithContext(ctx context.Context, path, otp, | ||||
| 		"pgp_key": pgpKey, | ||||
| 	} | ||||
|  | ||||
| 	r := c.c.NewRequest("PUT", path) | ||||
| 	r := c.c.NewRequest(http.MethodPut, path) | ||||
| 	if err := r.SetJSONBody(body); err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| @@ -120,7 +123,7 @@ func (c *Sys) generateRootCancelCommonWithContext(ctx context.Context, path stri | ||||
| 	ctx, cancelFunc := c.c.withConfiguredTimeout(ctx) | ||||
| 	defer cancelFunc() | ||||
|  | ||||
| 	r := c.c.NewRequest("DELETE", path) | ||||
| 	r := c.c.NewRequest(http.MethodDelete, path) | ||||
|  | ||||
| 	resp, err := c.c.rawRequestWithContext(ctx, r) | ||||
| 	if err == nil { | ||||
| @@ -162,7 +165,7 @@ func (c *Sys) generateRootUpdateCommonWithContext(ctx context.Context, path, sha | ||||
| 		"nonce": nonce, | ||||
| 	} | ||||
|  | ||||
| 	r := c.c.NewRequest("PUT", path) | ||||
| 	r := c.c.NewRequest(http.MethodPut, path) | ||||
| 	if err := r.SetJSONBody(body); err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user