Skip to content

No upper-bound guardrail for individual sitemap URL count (50,000 limit) #50

Description

@fomadev-admin

Description:
The sitemap index builder enforces the 50,000 entry limit for index files, but the main generateXml() function does not enforce any limit on the number of <url> entries. Per the sitemaps.org specification, a single sitemap file must not exceed 50,000 URLs or 50MB uncompressed.

A user could unknowingly pass 200,000 entries to getServerSitemapResponse(), generating an invalid XML payload that Google will reject.

Recommendation: Add a similar guardrail in generateXml():

if (entries.length > 50000) {
  throw new Error('[next-advanced-sitemap] ...');
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions