Drop the domain from public AI prompt URLs.
Copied links now use business name and prompt name only; old host-prefixed URLs still resolve. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
73588db1c6
commit
dcf8b6423a
@@ -101,19 +101,19 @@ export class AiPromptsController {
|
||||
|
||||
@Get('public/ai-prompts/:host/:name/:prompt/:publicId')
|
||||
@Header('Content-Type', 'text/plain; charset=utf-8')
|
||||
getPublicFull(@Param('publicId') publicId: string) {
|
||||
getPublicLegacyHost(@Param('publicId') publicId: string) {
|
||||
return this.service.getPublicText(publicId);
|
||||
}
|
||||
|
||||
@Get('public/ai-prompts/:host/:name/:publicId')
|
||||
@Get('public/ai-prompts/:name/:prompt/:publicId')
|
||||
@Header('Content-Type', 'text/plain; charset=utf-8')
|
||||
getPublicLabeled(@Param('publicId') publicId: string) {
|
||||
return this.service.getPublicText(publicId);
|
||||
}
|
||||
|
||||
@Get('public/ai-prompts/:host/:publicId')
|
||||
@Get('public/ai-prompts/:name/:publicId')
|
||||
@Header('Content-Type', 'text/plain; charset=utf-8')
|
||||
getPublicHost(@Param('publicId') publicId: string) {
|
||||
getPublicNamed(@Param('publicId') publicId: string) {
|
||||
return this.service.getPublicText(publicId);
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@ export class AiPromptsService {
|
||||
private publicUrl(
|
||||
publicId: string,
|
||||
labels?: {
|
||||
host?: string | null;
|
||||
name?: string | null;
|
||||
promptName?: string | null;
|
||||
},
|
||||
@@ -63,7 +62,6 @@ export class AiPromptsService {
|
||||
const base =
|
||||
this.config.get<string>('API_PUBLIC_BASE_URL')?.replace(/\/$/, '') ||
|
||||
'https://api.meshkee.com';
|
||||
const host = labels?.host?.trim().toLowerCase();
|
||||
const nameSlug = labels?.name?.trim()
|
||||
? this.slugSegment(labels.name)
|
||||
: '';
|
||||
@@ -71,7 +69,6 @@ export class AiPromptsService {
|
||||
? this.slugSegment(labels.promptName)
|
||||
: '';
|
||||
const parts = [
|
||||
host ? encodeURIComponent(host) : '',
|
||||
nameSlug ? encodeURIComponent(nameSlug) : '',
|
||||
promptSlug ? encodeURIComponent(promptSlug) : '',
|
||||
publicId,
|
||||
@@ -120,7 +117,6 @@ export class AiPromptsService {
|
||||
body: row.body,
|
||||
publicId: row.publicId,
|
||||
publicUrl: this.publicUrl(row.publicId, {
|
||||
host: labels?.host,
|
||||
name: labels?.name,
|
||||
promptName: row.name,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user