Skip to content

Commit 8472634

Browse files
committed
Constify the init secret length
Unexport it since this is internal.
1 parent 3c39343 commit 8472634

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

internal/abi/fastly/hostcalls_guest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2268,7 +2268,7 @@ func (s *Secret) Plaintext() ([]byte, error) {
22682268
// Most secrets will fit into the initial secret buffer size, so
22692269
// we'll start with that. If it doesn't fit, we'll know the exact
22702270
// size of the buffer to try again.
2271-
buf := prim.NewWriteBuffer(InitialSecretLen)
2271+
buf := prim.NewWriteBuffer(initialSecretLen)
22722272

22732273
status := fastlySecretPlaintext(
22742274
s.h,

internal/abi/fastly/types.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,6 @@ const (
278278
cacheOverrideTagPCI cacheOverrideTag = 0b0000_1000 // $pci
279279
)
280280

281-
// InitialSecretLen is the initial size of the buffer to use for decrypting secrets
282-
var InitialSecretLen = 1024
283-
284281
const (
285282
// DefaultMaxHeaderNameLen is the default header name length limit
286283
DefaultMaxHeaderNameLen = 8192
@@ -293,6 +290,8 @@ const (
293290

294291
dictionaryValueMaxLen = 8192 // https://docs.fastly.com/en/guides/about-edge-dictionaries#limitations-and-considerations
295292
defaultBufferLen = 16 * 1024
293+
294+
initialSecretLen = 1024
296295
)
297296

298297
// CacheOverrideOptions collects specific, caching-related options for outbound

0 commit comments

Comments
 (0)