about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-05-11 18:12:42 +0200
committerThibaut Girka <thib@sitedethib.com>2018-05-11 18:12:42 +0200
commit45fce0e496727cd1579c630c22592638341f78c6 (patch)
treeff72ae5b3482e4df7885e1e5a38c982529fd11c4 /app/lib
parent34142ab29c33104793afe3199f102d84b83b9b57 (diff)
parent352bae8c3ef2aca41de4aacb85d5e036a1d2bace (diff)
Merge branch 'master' into glitch-soc/merge
Conflicts:
	app/controllers/invites_controller.rb
	app/serializers/initial_state_serializer.rb
	config/locales/ko.yml
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/request.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/lib/request.rb b/app/lib/request.rb
index fc7d398e0..731bf7687 100644
--- a/app/lib/request.rb
+++ b/app/lib/request.rb
@@ -51,16 +51,17 @@ class Request
   end
 
   def headers
-    (@account ? @headers.merge('Signature' => signature) : @headers).reverse_merge('Accept-Encoding' => 'gzip').without(REQUEST_TARGET)
+    (@account ? @headers.merge('Signature' => signature) : @headers).without(REQUEST_TARGET)
   end
 
   private
 
   def set_common_headers!
-    @headers[REQUEST_TARGET] = "#{@verb} #{@url.path}"
-    @headers['User-Agent']   = user_agent
-    @headers['Host']         = @url.host
-    @headers['Date']         = Time.now.utc.httpdate
+    @headers[REQUEST_TARGET]    = "#{@verb} #{@url.path}"
+    @headers['User-Agent']      = user_agent
+    @headers['Host']            = @url.host
+    @headers['Date']            = Time.now.utc.httpdate
+    @headers['Accept-Encoding'] = 'gzip' if @verb != :head
   end
 
   def set_digest!