File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ def valid_content_encoding?(content_encoding)
9595 end
9696
9797 def response ( code , content_type , body )
98- [ code , { "Content-Type" => content_type } , body ]
98+ [ code , { Otlp :: CONTENT_TYPE => content_type } , body ]
9999 end
100100
101101 def response_unsupported_media_type
Original file line number Diff line number Diff line change 44require "openssl"
55
66module Fluent ::Plugin ::Otlp
7+ CONTENT_TYPE = "Content-Type"
78 CONTENT_TYPE_PAIN = "text/plain"
89 CONTENT_TYPE_PROTOBUF = "application/x-protobuf"
910 CONTENT_TYPE_JSON = "application/json"
1011
12+ CONTENT_ENCODING = "Content-Encoding"
1113 CONTENT_ENCODING_GZIP = "gzip"
1214
1315 RECORD_TYPE_LOGS = "otlp_logs"
Original file line number Diff line number Diff line change @@ -107,9 +107,9 @@ def create_connection(chunk)
107107 raise ::Fluent ::UnrecoverableError , e . message
108108 end
109109
110- headers = { "Content-Type" => Otlp ::CONTENT_TYPE_PROTOBUF }
110+ headers = { Otlp :: CONTENT_TYPE => Otlp ::CONTENT_TYPE_PROTOBUF }
111111 if @compress == :gzip
112- headers [ "Content-Encoding" ] = Otlp ::CONTENT_ENCODING_GZIP
112+ headers [ Otlp :: CONTENT_ENCODING ] = Otlp ::CONTENT_ENCODING_GZIP
113113 gz = Zlib ::GzipWriter . new ( StringIO . new )
114114 gz << body
115115 body = gz . close . string
You can’t perform that action at this time.
0 commit comments