mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
fix(workflow-auth): adding workflowId param to only internal urls (#1710)
This commit is contained in:
committed by
GitHub
parent
4d7ebd8bcb
commit
b8bc632baa
@@ -429,7 +429,10 @@ async function handleInternalRequest(
|
||||
typeof tool.request.url === 'function' ? tool.request.url(params) : tool.request.url
|
||||
|
||||
const fullUrlObj = new URL(endpointUrl, baseUrl)
|
||||
if (executionContext?.workflowId && typeof window === 'undefined') {
|
||||
const isInternalRoute = endpointUrl.startsWith('/api/')
|
||||
|
||||
// Only add workflowId to internal routes, not external APIs
|
||||
if (executionContext?.workflowId && typeof window === 'undefined' && isInternalRoute) {
|
||||
fullUrlObj.searchParams.set('workflowId', executionContext.workflowId)
|
||||
}
|
||||
const fullUrl = fullUrlObj.toString()
|
||||
@@ -451,7 +454,6 @@ async function handleInternalRequest(
|
||||
}
|
||||
|
||||
const headers = new Headers(requestParams.headers)
|
||||
const isInternalRoute = endpointUrl.startsWith('/api/')
|
||||
if (typeof window === 'undefined') {
|
||||
if (isInternalRoute) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user