MCPcopy Create free account
hub / github.com/pollinations/pollinations / shouldRedirectWithTrailingSlash

Function shouldRedirectWithTrailingSlash

apps/websim/worker.js:186–193  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

184}
185
186function shouldRedirectWithTrailingSlash(path) {
187 if (path === "/" || path.endsWith("/")) {
188 return false;
189 }
190
191 const slashCount = (path.match(/\//g) || []).length;
192 return slashCount <= 1;
193}
194
195function extractPromptFromPath(path) {
196 const encodedPrompt = path.slice(1, path.endsWith("/") ? -1 : undefined);

Callers 1

processPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected