Skip to content

Commit

Permalink
Allow contentType to be null in calls to UploadObject.
Browse files Browse the repository at this point in the history
Fixes issue googleapis#117.
  • Loading branch information
jskeet committed Apr 27, 2016
1 parent 3e44287 commit b6c35ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Google.Storage.V1/StorageClient.UploadObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public abstract partial class StorageClient
/// <param name="bucket">The name of the bucket containing the object. Must not be null.</param>
/// <param name="objectName">The name of the object within the bucket. Must not be null.</param>
/// <param name="contentType">The content type of the object. This should be a MIME type
/// such as "text/html" or "application/octet-stream". Must not be null, but may be empty.</param>
/// such as "text/html" or "application/octet-stream". May be null.</param>
/// <param name="source">The stream to read the data from. Must not be null.</param>
/// <param name="options">Additional options for the upload. May be null, in which case appropriate
/// defaults will be used.</param>
Expand All @@ -52,7 +52,7 @@ public abstract partial class StorageClient
/// <param name="bucket">The name of the bucket containing the object. Must not be null.</param>
/// <param name="objectName">The name of the object within the bucket. Must not be null.</param>
/// <param name="contentType">The content type of the object. This should be a MIME type
/// such as "text/html" or "application/octet-stream". Must not be null, but may be empty.</param>
/// such as "text/html" or "application/octet-stream". May be null.</param>
/// <param name="source">The stream to read the data from. Must not be null.</param>
/// <returns>A task representing the asynchronous operation, with a result returning the
/// <see cref="Object"/> representation of the uploaded object.</returns>
Expand All @@ -67,7 +67,7 @@ public virtual Task<Object> UploadObjectAsync(string bucket, string objectName,
/// <param name="bucket">The name of the bucket containing the object. Must not be null.</param>
/// <param name="objectName">The name of the object within the bucket. Must not be null.</param>
/// <param name="contentType">The content type of the object. This should be a MIME type
/// such as "text/html" or "application/octet-stream". Must not be null, but may be empty.</param>
/// such as "text/html" or "application/octet-stream". May be null.</param>
/// <param name="source">The stream to read the data from. Must not be null.</param>
/// <param name="options">Additional options for the upload. May be null, in which case appropriate
/// defaults will be used.</param>
Expand Down
2 changes: 0 additions & 2 deletions src/Google.Storage.V1/StorageClientImpl.UploadObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public sealed partial class StorageClientImpl : StorageClient
{
ValidateBucket(bucket);
Preconditions.CheckNotNull(objectName, nameof(objectName));
Preconditions.CheckNotNull(contentType, nameof(contentType));
return UploadObject(
new Object { Bucket = bucket, Name = objectName, ContentType = contentType },
source, options, progress);
Expand All @@ -59,7 +58,6 @@ public override Task<Object> UploadObjectAsync(string bucket, string objectName,
{
ValidateBucket(bucket);
Preconditions.CheckNotNull(objectName, nameof(objectName));
Preconditions.CheckNotNull(contentType, nameof(contentType));
return UploadObjectAsync(new Object { Bucket = bucket, Name = objectName, ContentType = contentType },
source, options, cancellationToken, progress);
}
Expand Down

0 comments on commit b6c35ca

Please sign in to comment.