This repository has been archived by the owner. It is now read-only.

Configure per-service request headers for direct uploads #83

Merged
merged 2 commits into from Jul 30, 2017

Conversation

Projects
None yet
4 participants
@javan
Member

javan commented Jul 29, 2017

Really fixes #79
Eliminates the need for a direct-upload:before-storage-request hook in #36, re: #79 (comment)

/cc @dixpac

@javan javan requested review from dhh and georgeclaghorn Jul 29, 2017

Show outdated Hide outdated lib/active_storage/service/gcs_service.rb
Show outdated Hide outdated test/controllers/direct_uploads_controller_test.rb
end
private
def blob_args
params.require(:blob).permit(:filename, :byte_size, :checksum, :content_type, :metadata).to_h.symbolize_keys
end
def direct_upload_json(blob)
blob.as_json(methods: :signed_id).merge(direct_upload: {

This comment has been minimized.

@georgeclaghorn

georgeclaghorn Jul 29, 2017

Member

Do we need to return a complete JSON representation of the blob now?

@georgeclaghorn

georgeclaghorn Jul 29, 2017

Member

Do we need to return a complete JSON representation of the blob now?

This comment has been minimized.

@javan

javan Jul 29, 2017

Member

Not technically, but it robustifies the client-side API with a complete set of attributes from the server.

Before:
before
After:
after

@javan

javan Jul 29, 2017

Member

Not technically, but it robustifies the client-side API with a complete set of attributes from the server.

Before:
before
After:
after

@dixpac

This comment has been minimized.

Show comment
Hide comment
@dixpac

dixpac Jul 30, 2017

Contributor

Looks good to me 👏

Contributor

dixpac commented Jul 30, 2017

Looks good to me 👏

@dhh dhh merged commit 39bfc83 into master Jul 30, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@javan javan referenced this pull request Jul 30, 2017

Merged

Azure Storage support #36

5 of 5 tasks complete

@javan javan deleted the direct-upload-service-headers branch Jul 30, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.