File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -114,13 +114,17 @@ async function resolvePage(
114114 // If page can't be found, we try with the API, in case we have a redirect
115115 // We use the raw pathname to handle special/malformed redirects setup by users in the GitSync.
116116 // The page rendering will take care of redirecting to a normalized pathname.
117- const resolved = await getRevisionPageByPath (
118- contentTarget . spaceId ,
119- contentTarget . revisionId ,
120- rawPathname ,
121- ) ;
122- if ( resolved ) {
123- return resolvePageId ( pages , resolved . id ) ;
117+ //
118+ // We don't test path that are too long as GitBook doesn't support them and will return a 404 anyway.
119+ if ( rawPathname . length <= 512 ) {
120+ const resolved = await getRevisionPageByPath (
121+ contentTarget . spaceId ,
122+ contentTarget . revisionId ,
123+ rawPathname ,
124+ ) ;
125+ if ( resolved ) {
126+ return resolvePageId ( pages , resolved . id ) ;
127+ }
124128 }
125129
126130 return undefined ;
You can’t perform that action at this time.
0 commit comments