Skip to content

Commit 3c56842

Browse files
mishushakovajuijas
andauthored
fix(js-sdk): pass sandbox headers to EnvdApiClient (#1175)
## Summary - Fixes `Sandbox.create()` failing in self-hosted environments because `sandboxHeaders` were not propagated to `EnvdApiClient` - Spreads `sandboxHeaders` (`E2b-Sandbox-Id`, `E2b-Sandbox-Port`) into the headers passed to the envd API client Closes #1158 Based on #1159 by @ajuijas ## Test plan - [ ] Verify sandbox creation works in self-hosted environments - [ ] Verify sandbox headers are correctly passed to EnvdApiClient <!-- CURSOR_SUMMARY --> --- > [!NOTE] > <sup>[Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) is generating a summary for commit f78d8b5. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Signed-off-by: ajuijas <ijas.ahmd.ap@gmail.com> Co-authored-by: ajuijas <ijas.ahmd.ap@gmail.com>
1 parent 222105d commit 3c56842

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.changeset/tame-kiwis-listen.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'e2b': patch
3+
---
4+
5+
fix: pass sandbox headers to EnvdApiClient

packages/js-sdk/src/sandbox/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ export class Sandbox extends SandboxApi {
189189
accessToken: this.envdAccessToken,
190190
headers: {
191191
'User-Agent': this.connectionConfig.headers?.['User-Agent'] ?? '',
192+
...sandboxHeaders,
192193
...(this.envdAccessToken
193194
? { 'X-Access-Token': this.envdAccessToken }
194195
: {}),

0 commit comments

Comments
 (0)