Skip to content

Commit 8abed41

Browse files
committed
Fix incorrect content-type for help action
1 parent 44f0d14 commit 8abed41

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/http.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def request_to_command(request)
6666
command = super
6767

6868
if request.action == "help"
69+
request.set_response_header("content-type", "text/html")
6970
command.class.serializers = [Commands::Help::ResultSerializer]
7071
end
7172

src/http/request.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,14 @@ def prefixless_path
109109
path
110110
end
111111
end
112+
113+
def set_response_header(name, value)
114+
name = name.to_s
115+
name = name.downcase
116+
117+
self.response_headers ||= {}
118+
self.response_headers = response_headers.merge(name => value)
119+
end
112120
end
113121
end
114122
end

0 commit comments

Comments
 (0)