Fix (GraphQL): raise exception when blob is missing
Failures: 1) API::V2::GraphqlController when authenticated mutations dossierEnvoyerMessage upload error should fail Failure/Error: expect(gql_errors).to eq(nil) expected: nil got: [{:backtrace=>["/usr/local/bundle/ruby/2.7.0/gems/graphql-1.12.5/lib/graphql/backtrace/tracer.rb:64:i...]
This commit is contained in:
parent
691262340d
commit
cb717aede2
1 changed files with 2 additions and 0 deletions
|
@ -5,6 +5,8 @@ module Mutations
|
|||
def validate_blob(blob_id)
|
||||
begin
|
||||
blob = ActiveStorage::Blob.find_signed(blob_id)
|
||||
raise ActiveSupport::MessageVerifier::InvalidSignature if blob.nil?
|
||||
|
||||
# open downloads the file and checks its hash
|
||||
blob.open { |f| }
|
||||
true
|
||||
|
|
Loading…
Reference in a new issue