Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbcf6a84

Browse files
committed
acme: pass context to request
Fixesgolang/go#30183Change-Id: Ic02b34bc87b9465f5c05b2ef5bec157c58809a91Reviewed-on:https://go-review.googlesource.com/c/crypto/+/719002Reviewed-by: Junyang Shao <shaojunyang@google.com>Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>Reviewed-by: Roland Shoemaker <roland@golang.org>LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
1 parentb4f2b62 commitbcf6a84

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎acme/acme.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ func (c *Client) addNonce(h http.Header) {
690690
}
691691

692692
func (c*Client)fetchNonce(ctx context.Context,urlstring) (string,error) {
693-
r,err:=http.NewRequest("HEAD",url,nil)
693+
r,err:=http.NewRequestWithContext(ctx,"HEAD",url,nil)
694694
iferr!=nil {
695695
return"",err
696696
}

‎acme/http.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func wantStatus(codes ...int) resOkay {
128128
func (c*Client)get(ctx context.Context,urlstring,okresOkay) (*http.Response,error) {
129129
retry:=c.retryTimer()
130130
for {
131-
req,err:=http.NewRequest("GET",url,nil)
131+
req,err:=http.NewRequestWithContext(ctx,"GET",url,nil)
132132
iferr!=nil {
133133
returnnil,err
134134
}
@@ -228,7 +228,7 @@ func (c *Client) postNoRetry(ctx context.Context, key crypto.Signer, url string,
228228
iferr!=nil {
229229
returnnil,nil,err
230230
}
231-
req,err:=http.NewRequest("POST",url,bytes.NewReader(b))
231+
req,err:=http.NewRequestWithContext(ctx,"POST",url,bytes.NewReader(b))
232232
iferr!=nil {
233233
returnnil,nil,err
234234
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp