foobara-http-command-connector 0.0.20 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84f98d62ccf5d4607dfa7fcec72c146783afdcaf05fea4c6a783886d51a76446
4
- data.tar.gz: d5d43e938ff41147061148b8fdac2bc15f54dfa8303f3b3225079d49d880d200
3
+ metadata.gz: 22769d0e0887abf5103ffb9f4bfa11417e80d026d998ed77328c131c01b7fca6
4
+ data.tar.gz: 6d7faca835bb273f4a1842ad4ae3148b4d64f82506ab16208d8317949c4056af
5
5
  SHA512:
6
- metadata.gz: 40d905a7991b607b9b1dae7604969cb1eb40f357c1850bc743f2200a27badce71d6fc76d13680c348216047ec3c67587e83f23730657319839301c5c536e82bc
7
- data.tar.gz: 3a81ef2395e42ad2027b86d5e21651b3e9ba95db4be779964d0a954e025336a67bb01ac0aa91ab539d58076dcbd2663bdc5196cf10c177849f252bffed462f81
6
+ metadata.gz: cbae00de66959594c81d0ac9e68289e8165d2781cb8d89433cbc88fac14a55ca4fcfaf9f348fc01dfffff6d34072b1f4c58b558d04aa61ae15e8263469d1da2d
7
+ data.tar.gz: 846d2681b3674ea15e3a4a88a4032eb297e65b80b6251fd03433d1c0456cdf2b3f57b89d9969bd53f22b35a564d32e15c2c8a35acb695b3448803ae5d403dd0d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.0.21] - 2025-04-15
2
+
3
+ - Fix incorrect content-type for help action
4
+
1
5
  ## [0.0.20] - 2025-04-14
2
6
 
3
7
  - Handle more cors scenarios
@@ -35,7 +35,7 @@ module Foobara
35
35
  allow_headers = ENV.fetch("FOOBARA_HTTP_RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_HEADERS", nil)
36
36
  if allow_headers
37
37
  if allow_headers == "*"
38
- allow_headers = request.headers["HTTP_ACCESS_CONTROL_REQUEST_HEADERS"]
38
+ allow_headers = request.headers["access-control-request-headers"]
39
39
  end
40
40
  request.response_headers["access-control-allow-headers"] = allow_headers
41
41
  end
@@ -44,7 +44,7 @@ module Foobara
44
44
  determine_object_to_help_with(mode: Namespace::LookupMode::RELAXED)
45
45
  else
46
46
  # TODO: add an input error instead for missing record to trigger 404
47
- add_runtime_error(CommandConnector::NotFoundError.new(arg))
47
+ add_runtime_error(CommandConnector::NotFoundError.for(arg))
48
48
  end
49
49
  end
50
50
  else
data/src/http/request.rb CHANGED
@@ -109,6 +109,14 @@ module Foobara
109
109
  path
110
110
  end
111
111
  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
112
120
  end
113
121
  end
114
122
  end
data/src/http.rb CHANGED
@@ -66,6 +66,7 @@ module Foobara
66
66
  command = super
67
67
 
68
68
  if request.action == "help"
69
+ request.set_response_header("content-type", "text/html")
69
70
  command.class.serializers = [Commands::Help::ResultSerializer]
70
71
  end
71
72
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-http-command-connector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi