-
Notifications
You must be signed in to change notification settings - Fork 233
Description
Bug Report
Prerequisites
- Can you reproduce the problem?
- Are you running the latest version?
- Are you reporting to the correct repository?
- Did you perform a cursory search?
For more information, see the CONTRIBUTING guide.
Description
When creating batch requests with the interface BatchRequestStep using full URLs, the URL is incorrectly parsed. The host name is stripped away, but the versioning remains.
Creating a batch request step with URL https://graph.microsoft.com/v1.0/groups, the URL on the batch request body will be /v1.0/groups. This leads to Graph treating the versioning like a part of the request path, and responding with error code 400 with error message "Resource not found for the segment 'v1.0'."
Console Errors: [Is there any console error]
Screenshots: [If applicable, add screenshots to help explain your problem]
Steps to Reproduce
- Create a batch request step with url path:
const batchRequestStep: BatchRequestStep = {
id: '1',
request: new Request(`https://graph.microsoft.com/v1.0/groups`, {
method: 'GET',
}),
};
- Create an instance of
BatchRequestContentwith the batch request step
const batchRequestContent = new BatchRequestContent([batchRequestStep]);
- Retrieve the content and log out the URL
const batchRequestBody = await batchRequestContent.getContent();
console.log(batchRequestBody.requests[0].url);
Expected behavior: URL is parsed to /groups
Actual behavior: URL is parsed to /v1.0/groups
Usage Information
SDK Version - [SDK version you are using]
- Node (Check, if using Node version of SDK)
Node Version - v16.14.0