Skip to content

Commit b045b8e

Browse files
feat: support setting headers via env
1 parent 277c809 commit b045b8e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,14 @@ private constructor(
377377
(System.getProperty("openlayer.apiKey") ?: System.getenv("OPENLAYER_API_KEY"))?.let {
378378
apiKey(it)
379379
}
380+
System.getenv("OPENLAYER_CUSTOM_HEADERS")?.let { customHeadersEnv ->
381+
for (line in customHeadersEnv.split("\n")) {
382+
val colon = line.indexOf(':')
383+
if (colon >= 0) {
384+
putHeader(line.substring(0, colon).trim(), line.substring(colon + 1).trim())
385+
}
386+
}
387+
}
380388
}
381389

382390
/**

0 commit comments

Comments
 (0)