Skip to content

Commit

Permalink
Merge pull request #76 from microsoftgraph/mmainerworking
Browse files Browse the repository at this point in the history
Remove auth header from uploadchunkrequest.cs
  • Loading branch information
MIchaelMainer authored Feb 13, 2017
2 parents dbd8dfe + 5233d54 commit aa6eb24
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 20 deletions.
16 changes: 2 additions & 14 deletions src/Microsoft.Graph/Microsoft.Graph.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,11 @@
<projectUrl>https://graph.microsoft.io</projectUrl>
<licenseUrl>http://aka.ms/devservicesagreement</licenseUrl>
<releaseNotes>
November 2016 Release Summary (version 1.2.0)

New features

* Get a user's mailbox settings and drives.
* Extended properties on calendars, events, messages, contacts, posts, contact folders, and mail folders.
* OnlineMeetingUrl on event entities.
* Attachments on messages.
* New properties on drive items: content, cTag, package, parentReference, root, sharePointIds, size, webDavUrl, and permissions.
* Upload large files to OneDrive in chunks.
* Search OneDrive files.
* Send OneDrive file sharing invite to other people.
* LINQ enabled on select and expand query parameters.
February 2017 Release Summary (version 1.2.1)

Bug fixes

* Added missing configureAwait(false) in BaseRequest.cs to address potential deadlock scenario.
* Removed access token from resumable uploads as it is ignored by OneDrive for Business and causes an error for OneDrive for Consumer.
</releaseNotes>
<tags>Microsoft Office365 Graph GraphServiceClient Outlook OneDrive AzureAD GraphAPI Productivity SharePoint SDK</tags>
<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions src/Microsoft.Graph/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.2.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyVersion("1.2.1")]
[assembly: AssemblyFileVersion("1.2.1.0")]

#if DEBUG
[assembly: InternalsVisibleTo("Microsoft.Graph.Test")]
Expand Down
2 changes: 0 additions & 2 deletions src/Microsoft.Graph/Requests/UploadChunkRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ private async Task<HttpResponseMessage> SendRequestAsync(

using (var request = this.GetHttpRequestMessage())
{
await this.Client.AuthenticationProvider.AuthenticateRequestAsync(request).ConfigureAwait(false);

request.Content = new StreamContent(stream);
request.Content.Headers.ContentRange =
new ContentRangeHeaderValue(this.RangeBegin, this.RangeEnd, this.TotalSessionLength);
Expand Down
34 changes: 32 additions & 2 deletions tests/Microsoft.Graph.Test/Requests/Functional/OneDriveTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,18 @@ public async Task OneDriveUploadLargeFile()
using (System.IO.MemoryStream ms = new System.IO.MemoryStream(buff))
{
// Describe the file to upload. Pass into CreateUploadSession, when the service works as expected.
//var props = new DriveItemUploadableProperties();
var props = new DriveItemUploadableProperties();
//props.Name = "_hamilton.png";
//props.Description = "This is a pictureof Mr. Hamilton.";
//props.FileSystemInfo = new FileSystemInfo();
//props.FileSystemInfo.CreatedDateTime = System.DateTimeOffset.Now;
//props.FileSystemInfo.LastModifiedDateTime = System.DateTimeOffset.Now;
props.AdditionalData = new Dictionary<string, object>();
props.AdditionalData.Add("@microsoft.graph.conflictBehavior", "rename");

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

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

// Addressing https://github.com/microsoftgraph/MSGraph-SDK-Code-Generator/issues/71
//[TestMethod]
//public async Task OneDriveNextPageRequestRootItemWithPath()
//{
// try
// {
// // This calls contains the correct URL structure:
// var path = "Community Service";
// var driveItemsPage = await graphClient.Me.Drive.Root.ItemWithPath(path).Children.Request().Top(1).GetAsync(); // DriveItemChildrenCollectionRequest.GetAsync()
// // https://graph.microsoft.com/v1.0/me/drive/root:/Community%20Service:/children?$top=1
// // BUG: the nextLink returned by the service is incorrect.

// // Assert that path is being added to the request URL.
// StringAssert.Contains(driveItemsPage.NextPageRequest.RequestUrl, path, $"The path, '{path}' was not appended to the request URL.");

// // This call does not issue the correct URL. Notice that ":/Community%20Service:" segment is missing.
// driveItemsPage = await driveItemsPage.NextPageRequest.GetAsync();
// // Actual nextLink value used to populate the NextPageRequest URL
// // 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
// // Expected nextLink value used to populate the NextPageRequest URL
// // 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
// }
// catch (Microsoft.Graph.ServiceException e)
// {
// Assert.Fail("Something happened, check out a trace. Error code: {0}", e.Error.Code);
// }
//}

// http://graph.microsoft.io/en-us/docs/api-reference/v1.0/api/item_downloadcontent
[TestMethod]
public async Task OneDriveGetContent()
Expand Down

0 comments on commit aa6eb24

Please sign in to comment.