Skip to content

Commit 58e75c3

Browse files
feat: support setting headers via env
1 parent 344888d commit 58e75c3

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

onebusaway-sdk-java-core/src/main/kotlin/org/onebusaway/core/ClientOptions.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,14 @@ private constructor(
373373
(System.getProperty("onebusawaysdk.onebusawayApiKey")
374374
?: System.getenv("ONEBUSAWAY_API_KEY"))
375375
?.let { apiKey(it) }
376+
System.getenv("ONEBUSAWAY_SDK_CUSTOM_HEADERS")?.let { customHeadersEnv ->
377+
for (line in customHeadersEnv.split("\n")) {
378+
val colon = line.indexOf(':')
379+
if (colon >= 0) {
380+
putHeader(line.substring(0, colon).trim(), line.substring(colon + 1).trim())
381+
}
382+
}
383+
}
376384
}
377385

378386
/**

0 commit comments

Comments
 (0)