Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copied blob has incorrect content type #47

Closed
maf1024 opened this issue Jun 21, 2018 · 1 comment
Closed

Copied blob has incorrect content type #47

maf1024 opened this issue Jun 21, 2018 · 1 comment
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@maf1024
Copy link

maf1024 commented Jun 21, 2018

After copying a blob, the copy has a content type of "application/octet-stream" instead of whatever was on the source blob.

Example powershell code to reproduce below.
When it runs against a real Azure storage account, the copy's resultant content type is "image/png" as expected.

New-Item "emptyfile.zzz"

#Upload as blob
$ctx = New-AzureStorageContext -Local
$container = New-AzureStorageContainer "mime-bug-repro" -Context $ctx
$originalBlob = Set-AzureStorageBlobContent -Blob "emptyfile.zzz" -Container $container.Name -File "emptyfile.zzz" -BlobType Block -Properties @{"ContentType" = "image/png"} -Context $ctx

#Initiate copy
$copyJob = Start-AzureStorageBlobCopy -SrcBlob $originalBlob.Name -SrcContainer $container.Name -DestBlob "copy-of-emptyfile.zzz" -DestContainer $container.Name -Context $ctx -DestContext $ctx
#Wait for copy.
while(($copyJob | Get-AzureStorageBlobCopyState).Status -ne "Success")
{
    sleep 5
}

#Get copy
$copiedBlob = Get-AzureStorageBlob -Container $container.Name -Blob "copy-of-emptyfile.zzz" -Context $ctx 

#Check ContentType
"The content type of the copy is: $($copiedBlob.ContentType)"

#Clean up file and container
$container | Remove-AzureStorageContainer -Force
Remove-Item "emptyfile.zzz"
@XiaoningLiu XiaoningLiu added bug Something isn't working good first issue Good for newcomers labels Jul 18, 2018
@XiaoningLiu XiaoningLiu self-assigned this Jul 23, 2018
XiaoningLiu added a commit to XiaoningLiu/Azurite that referenced this issue Jul 26, 2018
swissarmykirpan pushed a commit to swissarmykirpan/Azurite that referenced this issue Aug 24, 2018
@XiaoningLiu
Copy link
Member

This issue should have be resolved.

edwin-huber added a commit that referenced this issue Sep 4, 2018
* Fix an issue with CORS when a preflight request has an empty headers list.

Without this fix, azurite would fail because it was trying to call

  request.httpProps[N.ACCESS_CONTROL_REQUEST_HEADERS].toLowerCase()

which will result in trying to call undefined.toLowerCase() if the preflight
request doesn't specify access-control-request-headers.

In addition, when validating a request against the CORS, the request would
fail to be validated if access-control-request-headers was empty.

* fixed so that when requesting single entity with PartitionKey and RowKey the emulator responds in the same way that the real azure table

* Always set the copyProgress field.

* Entity generator now accepts optional partition and row key

* Dockerfile: deterministic builds

Use explicit version tag 10.6-alpine instead of alpine to ensure a known
version is used. Copy package-lock.json before npm install to ensure
known dependencies are installed.

* Fixed #47 Copied blob has incorrect content type

* Update release-notes.md

* Added Azure/azure-storage-node as test submodule

Tests from azure-storage-node are invoked via
test/azure-storage-shim.js for direct npm run test support.

Submodule needs to be initialized with git submodule update --init first.

* Fix environment variable configuration

Added env-cmd package and test/.env to automatically set envs for
testing.

* Fix NOCK_OFF env and separate test folders

* Focus on test subset for easier fixing

* Updates to testing, requires changes to vscode launch.json with correct env args for each storage-node test, to ensure no nock etc

* Updated documentation for Azure storage testing

* Update azure-storage-node_tdd.md

* Updates to Table Storage API and associated tests (#78)

* Updated Readme and Package files

* Updates to table storage API and created corresponding tests using Azure-storage-node, this will form the basis of fixing further table API issues currently logged

* fixed up singleEntity response for QueryEntites action to return to method used by Karl Persson

* small correction to test logic

* Fixes for table queries not returning 404 for missing entities (#80)

* Updated Readme and Package files

* Updates to table storage API and created corresponding tests using Azure-storage-node, this will form the basis of fixing further table API issues currently logged
* fixed up singleEntity response for QueryEntites action to return to method used by Karl Persson
* small correction to test logic
* Changes to correctly return 404 for missing entities and failed queries.
* Updates errorCodes with EntityNotFound, updated tests
* minor updates to obj assignments
* added test to validate insertEntity returns Etag in metadata
* added jsHint config
* Updated table service error codes
* Corrected a few variable definitions let vs const

* Prettier Config for pull request

* fixed Create Entity Response to begin to conform to Azure Storage Response, we might need to do some more work here, but this should be enough for basic API functionality (#83)

* Update .prettierrc.json

* now everything is pretty, but still needs some refactoring

* Revert "now everything is pretty, but still needs some refactoring"

This reverts commit 4524b3b.
Need to rebase on dev branch before making super pretty...

* rebased onto dev and then pretified

* package.json update

* Prettier applied to conflicting files
gpatryk pushed a commit to gpatryk/Azurite that referenced this issue Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants