Skip to content

Commit ab67768

Browse files
feat: support setting headers via env
1 parent c337e61 commit ab67768

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,14 @@ private constructor(
433433
(System.getProperty("stagehand.modelApiKey") ?: System.getenv("MODEL_API_KEY"))?.let {
434434
modelApiKey(it)
435435
}
436+
System.getenv("STAGEHAND_CUSTOM_HEADERS")?.let { customHeadersEnv ->
437+
for (line in customHeadersEnv.split("\n")) {
438+
val colon = line.indexOf(':')
439+
if (colon >= 0) {
440+
putHeader(line.substring(0, colon).trim(), line.substring(colon + 1).trim())
441+
}
442+
}
443+
}
436444
}
437445

438446
/**

0 commit comments

Comments
 (0)