Skip to content

Commit 0493d0a

Browse files
feat: support setting headers via env
1 parent 36c34a0 commit 0493d0a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

lithic-java-core/src/main/kotlin/com/lithic/api/core/ClientOptions.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,14 @@ private constructor(
428428
}
429429
(System.getProperty("lithic.webhookSecret") ?: System.getenv("LITHIC_WEBHOOK_SECRET"))
430430
?.let { webhookSecret(it) }
431+
System.getenv("LITHIC_CUSTOM_HEADERS")?.let { customHeadersEnv ->
432+
for (line in customHeadersEnv.split("\n")) {
433+
val colon = line.indexOf(':')
434+
if (colon >= 0) {
435+
putHeader(line.substring(0, colon).trim(), line.substring(colon + 1).trim())
436+
}
437+
}
438+
}
431439
}
432440

433441
/**

0 commit comments

Comments
 (0)