Skip to content

Commit

Permalink
Encode name parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Giannis Chatziveroglou committed Jul 4, 2022
1 parent 73a7af9 commit fa743c7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/metadata-generator/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const getDefaultMetadata = (
cluster: string
): NFTMetadata => {
const imageUrl = `https://nft.cardinal.so/img/${mintId}${
nameParam ? `?name=${nameParam}` : ""
nameParam ? `?name=${encodeURIComponent(nameParam)}` : ""
}${cluster ? `${nameParam ? "&" : "?"}cluster=${cluster}` : ""}`;
return {
name: fullName,
Expand Down
2 changes: 1 addition & 1 deletion api/metadata-generator/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export async function getMetadata(
image: `https://nft.cardinal.so/img/${mintId}?uri=${
metadata?.image || ""
}${textParam ? `&text=${textParam}` : ""}${
nameParam ? `&name=${nameParam}` : ""
nameParam ? `&name=${encodeURIComponent(nameParam)}` : ""
}${cluster ? `&cluster=${cluster}` : ""}`,
};
}
Expand Down
2 changes: 1 addition & 1 deletion api/metadata-generator/twitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const getTwitterMetadata = (
cluster: string
): NFTMetadata => {
const imageUrl = `https://nft.cardinal.so/img/${mintId}?${
nameParam ? `&name=${nameParam}` : ""
nameParam ? `&name=${encodeURIComponent(nameParam)}` : ""
}${cluster ? `&cluster=${cluster}` : ""}`;
return {
name: fullName,
Expand Down

0 comments on commit fa743c7

Please sign in to comment.