Skip to content

Commit

Permalink
Fix docs for attestation client HTTP headers
Browse files Browse the repository at this point in the history
  • Loading branch information
hslatman committed May 21, 2024
1 parent 2c23fb4 commit d20fc2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tpm/attestation/requestid.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func RequestIDFromContext(ctx context.Context) (string, bool) {
}

// requestIDHeader is the header name used for propagating request IDs from
// the CA client to the CA and back again.
// the attestation client to the attestation CA and back again.
const requestIDHeader = "X-Request-Id"

// newRequestID generates a new random UUIDv4 request ID. If it fails,
Expand Down
4 changes: 3 additions & 1 deletion tpm/attestation/useragent.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package attestation

import "net/http"

// UserAgent will set the User-Agent header in the client requests.
// UserAgent is the value of the User-Agent HTTP header that will
// be set in HTTP requests to the attestation CA.
var UserAgent = "step-attestation-http-client/1.0"

// setUserAgent sets the User-Agent header in HTTP requests.
func setUserAgent(r *http.Request) {
r.Header.Set("User-Agent", UserAgent)
}

0 comments on commit d20fc2f

Please sign in to comment.