You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
client.api() throws "Unable to parse the URL" for relative paths containing https:// in the query #2039
client.api(path) throws Error: Unable to parse the URL: ... (GraphClientError) when given a relative path whose query string or OData function parameter contains https://, such as /sites?search=https://contoso.sharepoint.com or /me/events?$filter=onlineMeeting/joinUrl eq 'https://...'.
In 3.0.7, the same calls did not throw, but stripped https:// from the query and built a broken URL (https:/v1.0/sites?search=contoso.sharepoint.com).
Expected behavior
Relative paths should resolve against the configured base URL and version (https://graph.microsoft.com/v1.0/sites?search=https://contoso.sharepoint.com, etc.), matching the behavior of .query() and .filter() for the same values.
Unable to parse the URL: /sites?search=https://contoso.sharepoint.com
Unable to parse the URL: /me/events?$filter=onlineMeeting/joinUrl eq 'https://teams.microsoft.com/l/x'
Unable to parse the URL: /me/drive/root/search(q='https://example')
None (3.0.7 returned malformed URLs such as https:/v1.0/sites?search=contoso.sharepoint.com instead of throwing)
Known Workarounds
Pass the parameter through .query() / .filter() instead of inline in api(), or percent-encode :// in the parameter value.
Debug output
Click to expand log
Error: Unable to parse the URL: /sites?search=https://contoso.sharepoint.com
at new GraphClientError (node_modules/@microsoft/microsoft-graph-client/lib/src/GraphClientError.js:30:28)
at GraphRequest.parsePath (node_modules/@microsoft/microsoft-graph-client/lib/src/GraphRequest.js:51:27)
at new GraphRequest (node_modules/@microsoft/microsoft-graph-client/lib/src/GraphRequest.js:105:14)
at Client.api (node_modules/@microsoft/microsoft-graph-client/lib/src/Client.js:97:16)
Configuration
OS: Linux x64
Node.js: v26.13.0 (not OS- or runtime-specific)
Other information
GraphRequest.parsePath (src/GraphRequest.ts, line 134) checks if (path.indexOf("https://") !== -1) to decide whether path is an absolute URL, and PR #2000 added new URL(path) inside that branch. Checking whether path starts with https:// (case-insensitively) instead of indexOf would avoid treating query values containing https:// as absolute URLs.
Activity