fix: Fix the RudderStack config response format (no-changelog) (#18242)

This commit is contained in:
Svetoslav Dekov
2025-08-12 15:21:57 +03:00
committed by GitHub
parent d2cc939725
commit 19946c3f72

View File

@@ -39,8 +39,12 @@ export class TelemetryController {
async page(req: AuthenticatedRequest, res: Response, next: NextFunction) {
await this.proxy(req, res, next);
}
@Get('/rudderstack/sourceConfig', { skipAuth: true, rateLimit: { limit: 50, windowMs: 60_000 } })
async sourceConfig() {
@Get('/rudderstack/sourceConfig', {
skipAuth: true,
rateLimit: { limit: 50, windowMs: 60_000 },
usesTemplates: true,
})
async sourceConfig(_: Request, res: Response) {
const response = await fetch('https://api-rs.n8n.io/sourceConfig', {
headers: {
authorization:
@@ -54,6 +58,7 @@ export class TelemetryController {
const config: unknown = await response.json();
return config;
// write directly to response to avoid wrapping the config in `data` key which is not expected by RudderStack sdk
res.json(config);
}
}