-
Notifications
You must be signed in to change notification settings - Fork 310
Open
Description
Major Version
4.x
Minor Version Number
4.12.0
Target environment
All
Additional environment details
I'm using NodeJS v22.14.0
Expected or Desired Behavior
When I use the IWeb getFolderByServerRelativePath API I want to be able to use folder names including special characters like % and #. Currently when the folder name contains # in pnp v 4.12.0 the request is not handled correctly and resolves in 404 not found error because of truncated URLs.
Observed Behavior
When I call the API with parentFolderServerRelativeUrl='/sites/xxx/UploadDocumentLibraryLarge/test/xxx/test # test':
const test = await webRef.getFolderByServerRelativePath(parentFolderServerRelativeUrl);
const testItem = await test.getItem();
The request in the network tab is truncated before the #
Steps to Reproduce
Here is a snippet of the Sample-Code:
try {
if (parentFolderServerRelativeUrl) {
const test = await webRef.getFolderByServerRelativePath(parentFolderServerRelativeUrl);
const testItem = await test.getItem();
if (testItem) {
console.log('testItem', testItem);
}
}
}
catch (err) { ... }
When the folder has # as a special character, the test.getItem() method results in an error.
Reactions are currently unavailable