Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Storage emulator fixes and added rewriteTo support (#3647)
* Added missing return type * Set default cache-control header * Try to derive eTag from file bytes * Use content-encoding from metadata * Added in other file headers * Improved comment * Extracted out crc32c encoding to separate function * Added in x-goog-hash header with encoded crc32c value and MD5 hash * Match 404 object errors to API * Fixed range requests Simplified to use express' Request#range method and corrected end to be used as an inclusive bound * When STORAGE_EMULATOR_DEBUG env is set, still return 501 status code * Added support for rewriteTo and copyTo in the storage emulator * Added contentDisposition into metadata * Convert custom metadata values to strings and added integration test to admin SDK for removing values * Match 404 object errors to API for non-GET endpoints * Changed to use declared imports to match other fs usage * No need to check for directory existence before trying to create it when using the recursive flag * Stored files flat inside bucket directory, and URL encode the path components * Fixed typo in skipped test * Corrected list objects endpoint when using prefix and delimiter to return correct items and include prefixes * Support for pageTokens and maxResults in objects: list * Refactored Firebase storage#listAll endpoint to call generic listItems * #upload test to check provided custom metadata is set * Better tests for #copy to check original files metadata is copied * Updated #copy() to overwrite all custom metadata, not only provided keys * Updated #copy() to convert null custom metadata values to empty strings * Refactored objects: rewrite / copy endpoint to method in storage layer * Handle firebaseStorageDownloadTokens for objects: rewrite / copy * Consistent case for constant test variable * Changed iterating over objects with Object.keys to use Object.entries * Clearer circumventing the type-system * Base eTags on object generation and metadata generation for uniqueness across objects regardless of file content * Refactored StorageLayer#listItemsAndPrefixes to use #listItems and moved specfic Firebase and gcloud formats to those APIs * Removed unused import * Handled cache control and content language metadata and added tests * Integration tests for File#exists * Updated CHANGELOG * Comment on boolean argument * Fixed end to end test storage import/export
- Loading branch information