π¨ The ultimate agentic social media scheduling tool π€
TypeScript nextjsopen-sourceopen-source-social-media-scheduling-toolosspostiz-cloudpostiz-hostedredisscheduling-toolsocial-media-scheduling-tooltypescript
fix(wordpress): send a Postiz User-Agent on requests to the WordPress site
Gilad Resisib0103f73f453
diff --git a/libraries/nestjs-libraries/src/integrations/social/wordpress.provider.ts b/libraries/nestjs-libraries/src/integrations/social/wordpress.provider.tsindex 2f9b59784..8777a7c4b 100644--- a/libraries/nestjs-libraries/src/integrations/social/wordpress.provider.ts+++ b/libraries/nestjs-libraries/src/integrations/social/wordpress.provider.ts@@ -15,6 +15,8 @@ import { Tool } from '@gitroom/nestjs-libraries/integrations/tool.decorator';import { getSsrfSafeDispatcher } from '@gitroom/nestjs-libraries/dtos/webhooks/ssrf.safe.dispatcher';import { string } from 'yup';+const WORDPRESS_USER_AGENT = 'Postiz/1.0 (+https://postiz.com)';+export class WordpressProviderextends SocialAbstractimplements SocialProvider@@ -114,6 +116,7 @@ export class WordpressProviderresponse = await fetch(`${domain}/wp-json/wp/v2/users/me`, {headers: {Authorization: `Basic ${auth}`,+ 'User-Agent': WORDPRESS_USER_AGENT,},// @ts-ignore - undici-only option; blocks SSRF to internal IPsdispatcher: getSsrfSafeDispatcher(),@@ -212,6 +215,7 @@ export class WordpressProviderconst response = await fetch(`${body.domain}${path}`, {headers: {Authorization: `Basic ${auth}`,+ 'User-Agent': WORDPRESS_USER_AGENT,},// @ts-ignore - undici-only option; blocks SSRF to internal IPsdispatcher: getSsrfSafeDispatcher(),@@ -312,6 +316,7 @@ export class WordpressProvider.split('/').pop()}"`,'Content-Type': blob.type,+ 'User-Agent': WORDPRESS_USER_AGENT,},body: blob,})@@ -334,6 +339,7 @@ export class WordpressProviderheaders: {Authorization: `Basic ${auth}`,'Content-Type': 'application/json',+ 'User-Agent': WORDPRESS_USER_AGENT,},method: 'POST',body: JSON.stringify({