Skip to content

Commit aa6eb24

Browse files
Merge pull request #76 from microsoftgraph/mmainerworking
Remove auth header from uploadchunkrequest.cs
2 parents dbd8dfe + 5233d54 commit aa6eb24

File tree

4 files changed

+36
-20
lines changed

4 files changed

+36
-20
lines changed

src/Microsoft.Graph/Microsoft.Graph.nuspec

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,11 @@
1313
<projectUrl>https://graph.microsoft.io</projectUrl>
1414
<licenseUrl>http://aka.ms/devservicesagreement</licenseUrl>
1515
<releaseNotes>
16-
November 2016 Release Summary (version 1.2.0)
17-
18-
New features
19-
20-
* Get a user's mailbox settings and drives.
21-
* Extended properties on calendars, events, messages, contacts, posts, contact folders, and mail folders.
22-
* OnlineMeetingUrl on event entities.
23-
* Attachments on messages.
24-
* New properties on drive items: content, cTag, package, parentReference, root, sharePointIds, size, webDavUrl, and permissions.
25-
* Upload large files to OneDrive in chunks.
26-
* Search OneDrive files.
27-
* Send OneDrive file sharing invite to other people.
28-
* LINQ enabled on select and expand query parameters.
16+
February 2017 Release Summary (version 1.2.1)
2917

3018
Bug fixes
3119

32-
* Added missing configureAwait(false) in BaseRequest.cs to address potential deadlock scenario.
20+
* Removed access token from resumable uploads as it is ignored by OneDrive for Business and causes an error for OneDrive for Consumer.
3321
</releaseNotes>
3422
<tags>Microsoft Office365 Graph GraphServiceClient Outlook OneDrive AzureAD GraphAPI Productivity SharePoint SDK</tags>
3523
<dependencies>

src/Microsoft.Graph/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
//
2525
// You can specify all the values or you can default the Build and Revision Numbers
2626
// by using the '*' as shown below:
27-
[assembly: AssemblyVersion("1.2.0")]
28-
[assembly: AssemblyFileVersion("1.2.0.0")]
27+
[assembly: AssemblyVersion("1.2.1")]
28+
[assembly: AssemblyFileVersion("1.2.1.0")]
2929

3030
#if DEBUG
3131
[assembly: InternalsVisibleTo("Microsoft.Graph.Test")]

src/Microsoft.Graph/Requests/UploadChunkRequest.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ private async Task<HttpResponseMessage> SendRequestAsync(
137137

138138
using (var request = this.GetHttpRequestMessage())
139139
{
140-
await this.Client.AuthenticationProvider.AuthenticateRequestAsync(request).ConfigureAwait(false);
141-
142140
request.Content = new StreamContent(stream);
143141
request.Content.Headers.ContentRange =
144142
new ContentRangeHeaderValue(this.RangeBegin, this.RangeEnd, this.TotalSessionLength);

tests/Microsoft.Graph.Test/Requests/Functional/OneDriveTests.cs

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@ public async Task OneDriveUploadLargeFile()
2222
using (System.IO.MemoryStream ms = new System.IO.MemoryStream(buff))
2323
{
2424
// Describe the file to upload. Pass into CreateUploadSession, when the service works as expected.
25-
//var props = new DriveItemUploadableProperties();
25+
var props = new DriveItemUploadableProperties();
2626
//props.Name = "_hamilton.png";
2727
//props.Description = "This is a pictureof Mr. Hamilton.";
2828
//props.FileSystemInfo = new FileSystemInfo();
2929
//props.FileSystemInfo.CreatedDateTime = System.DateTimeOffset.Now;
3030
//props.FileSystemInfo.LastModifiedDateTime = System.DateTimeOffset.Now;
31+
props.AdditionalData = new Dictionary<string, object>();
32+
props.AdditionalData.Add("@microsoft.graph.conflictBehavior", "rename");
3133

3234
// Get the provider.
3335
// POST /v1.0/drive/items/01KGPRHTV6Y2GOVW7725BZO354PWSELRRZ:/_hamiltion.png:/microsoft.graph.createUploadSession
34-
// The CreateUploadSesssion action doesn't seem to support the options stated in the metadata.
36+
// The CreateUploadSesssion action doesn't seem to support the options stated in the metadata. This issue has been filed.
3537
var uploadSession = await graphClient.Drive.Items["01KGPRHTV6Y2GOVW7725BZO354PWSELRRZ"].ItemWithPath("_hamilton.png").CreateUploadSession().Request().PostAsync();
3638

3739
var maxChunkSize = 320 * 1024; // 320 KB - Change this to your chunk size. 5MB is the default.
@@ -97,6 +99,34 @@ public async Task OneDriveNextPageRequest()
9799
}
98100
}
99101

102+
// Addressing https://github.com/microsoftgraph/MSGraph-SDK-Code-Generator/issues/71
103+
//[TestMethod]
104+
//public async Task OneDriveNextPageRequestRootItemWithPath()
105+
//{
106+
// try
107+
// {
108+
// // This calls contains the correct URL structure:
109+
// var path = "Community Service";
110+
// var driveItemsPage = await graphClient.Me.Drive.Root.ItemWithPath(path).Children.Request().Top(1).GetAsync(); // DriveItemChildrenCollectionRequest.GetAsync()
111+
// // https://graph.microsoft.com/v1.0/me/drive/root:/Community%20Service:/children?$top=1
112+
// // BUG: the nextLink returned by the service is incorrect.
113+
114+
// // Assert that path is being added to the request URL.
115+
// StringAssert.Contains(driveItemsPage.NextPageRequest.RequestUrl, path, $"The path, '{path}' was not appended to the request URL.");
116+
117+
// // This call does not issue the correct URL. Notice that ":/Community%20Service:" segment is missing.
118+
// driveItemsPage = await driveItemsPage.NextPageRequest.GetAsync();
119+
// // Actual nextLink value used to populate the NextPageRequest URL
120+
// // https://graph.microsoft.com/v1.0/me/drive/root/children?$top=1&$skiptoken=Paged%3dTRUE%26p_SortBehavior%3d0%26p_FileRef%3dpersonal%252fgarthf%255fmod810997%255fonmicrosoft%255fcom%252fDocuments%252fCommunity%2520Service%252fBook%252exlsx%26p_ID%3d390%26RootFolder%3d%252fpersonal%252fgarthf%255fmod810997%255fonmicrosoft%255fcom%252fDocuments%252fCommunity%2520Service
121+
// // Expected nextLink value used to populate the NextPageRequest URL
122+
// // https://graph.microsoft.com/v1.0/me/drive/root:/Community%20Service:/children?$top=1&$skiptoken=Paged%3dTRUE%26p_SortBehavior%3d0%26p_FileRef%3dpersonal%252fgarthf%255fmod810997%255fonmicrosoft%255fcom%252fDocuments%252fCommunity%2520Service%252fBook%252exlsx%26p_ID%3d390%26RootFolder%3d%252fpersonal%252fgarthf%255fmod810997%255fonmicrosoft%255fcom%252fDocuments%252fCommunity%2520Service
123+
// }
124+
// catch (Microsoft.Graph.ServiceException e)
125+
// {
126+
// Assert.Fail("Something happened, check out a trace. Error code: {0}", e.Error.Code);
127+
// }
128+
//}
129+
100130
// http://graph.microsoft.io/en-us/docs/api-reference/v1.0/api/item_downloadcontent
101131
[TestMethod]
102132
public async Task OneDriveGetContent()

0 commit comments

Comments
 (0)