Description
If a part of the specified hostname in the spo folder add command (but possible other commands as well) is uppercase, creating the folder will fail with an error.
This issue is caused by the fact that url.parse in Utils.getServerRelativePath converts the specified URL to lowercase, but if the original URL is uppercase, then resolving the server-relative URL by replacing the server-part of the URL will fail.
Steps to reproduce
m365 spo folder add --webUrl 'https://CONTOSO.sharepoint.com/sites/docs' --parentFolderUrl '/SiteAssets' --name 'assets'
Expected result
Folder created
Actual result
400 error
Environment
v3.4.0@next
Description
If a part of the specified hostname in the
spo folder addcommand (but possible other commands as well) is uppercase, creating the folder will fail with an error.This issue is caused by the fact that
url.parseinUtils.getServerRelativePathconverts the specified URL to lowercase, but if the original URL is uppercase, then resolving the server-relative URL by replacing the server-part of the URL will fail.Steps to reproduce
m365 spo folder add --webUrl 'https://CONTOSO.sharepoint.com/sites/docs' --parentFolderUrl '/SiteAssets' --name 'assets'
Expected result
Folder created
Actual result
400 error
Environment
v3.4.0@next