Skip to content

Commit c31a472

Browse files
feat: support setting headers via env
1 parent 38a6f10 commit c31a472

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

image-kit-java-core/src/main/kotlin/io/imagekit/core/ClientOptions.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,14 @@ private constructor(
436436
(System.getProperty("imagekit.imagekitWebhookSecret")
437437
?: System.getenv("IMAGEKIT_WEBHOOK_SECRET"))
438438
?.let { webhookSecret(it) }
439+
System.getenv("IMAGE_KIT_CUSTOM_HEADERS")?.let { customHeadersEnv ->
440+
for (line in customHeadersEnv.split("\n")) {
441+
val colon = line.indexOf(':')
442+
if (colon >= 0) {
443+
putHeader(line.substring(0, colon).trim(), line.substring(colon + 1).trim())
444+
}
445+
}
446+
}
439447
}
440448

441449
/**

0 commit comments

Comments
 (0)