From 85763ece2ff045adf731a7c756f6f7d429e6bd89 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Tue, 5 Nov 2019 08:28:54 -0800 Subject: [PATCH] fix: Prevent upload requests from form-encoding their queries --- lib/google/apis/core/upload.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/google/apis/core/upload.rb b/lib/google/apis/core/upload.rb index b7815c11e..08e2a67c6 100644 --- a/lib/google/apis/core/upload.rb +++ b/lib/google/apis/core/upload.rb @@ -138,6 +138,10 @@ module Google @state = :start @upload_url = nil @offset = 0 + # Prevent the command from populating the body with form encoding, by + # asserting that it already has a body. Form encoding is never used + # by upload requests. + self.body = '' unless self.body super end