mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
fix: Fix the RudderStack config response format (no-changelog) (#18242)
This commit is contained in:
@@ -39,8 +39,12 @@ export class TelemetryController {
|
|||||||
async page(req: AuthenticatedRequest, res: Response, next: NextFunction) {
|
async page(req: AuthenticatedRequest, res: Response, next: NextFunction) {
|
||||||
await this.proxy(req, res, next);
|
await this.proxy(req, res, next);
|
||||||
}
|
}
|
||||||
@Get('/rudderstack/sourceConfig', { skipAuth: true, rateLimit: { limit: 50, windowMs: 60_000 } })
|
@Get('/rudderstack/sourceConfig', {
|
||||||
async 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', {
|
const response = await fetch('https://api-rs.n8n.io/sourceConfig', {
|
||||||
headers: {
|
headers: {
|
||||||
authorization:
|
authorization:
|
||||||
@@ -54,6 +58,7 @@ export class TelemetryController {
|
|||||||
|
|
||||||
const config: unknown = await response.json();
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user