Skip to content

Commit e27c47f

Browse files
authored
Merge pull request cloudflare#133 from cloudflare/fix/r2-screenshots
fix: use CUSTOM_DOMAIN env var instead of hostname for r2 screenshot urls
2 parents 8c7a97e + 33eb6fc commit e27c47f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

worker/agents/core/simpleGeneratorAgent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export class SimpleCodeGeneratorAgent extends Agent<Env, CodeGenState> {
203203
// Build a public URL served via Worker route
204204
const fileName = key.split('/').pop() as string;
205205
const protocol = getProtocolForHost(this.state.hostname);
206-
const base = this.state.hostname ? `${protocol}://${this.state.hostname}` : '';
206+
const base = `${protocol}://${this.env.CUSTOM_DOMAIN}`;
207207
const agentId = this.state.inferenceContext.agentId;
208208
const url = `${base}/api/screenshots/${encodeURIComponent(agentId)}/${encodeURIComponent(fileName)}`;
209209
return url;

0 commit comments

Comments
 (0)