sensu 0.25.1 → 0.25.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 19bd6d37e7a3469cf8843acad5f5c81d2a347ded
4
- data.tar.gz: 89da9643307324c2f440db263161a9ed8b627518
3
+ metadata.gz: 53fdc73c392979cab9dbc537fe2cd118d40692c5
4
+ data.tar.gz: 0656b8f002a58d2785e0b84dc7550efeb64e8dfb
5
5
  SHA512:
6
- metadata.gz: d3d4e5a2d67bdd71bb97212817e37975d7bf11dbb79e1f8bb258bf077bdcb9d1fd87d6915cb348418d09fa5f347838acab146a0765e7e83a5198139978e4f782
7
- data.tar.gz: 66800eace87138e73edaab346f06b64ddb9b43ecae386c4aad8ec427b953ea819e3d159b1c9ce6ab99099a2302216744acf966fad384cb2e5f8d8f303a8ff190
6
+ metadata.gz: 93ac81536b9e6370157c0d87eaab2a22c73fc8769a0ccf44bbbeb3fa053561627470a6b60f99fc0ebe76cf889c5e092d88592eebfdc6386f107fa9898f84ab01
7
+ data.tar.gz: a23633c7703136d4b92ab344f3e4619357eee34ddb274d268fd6612ace5be433095805af92d2995bad5a1d7d3248f48feb070414fb40b0fe433dc4782ed42f6e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 0.25.2 - 2016-06-16
2
+
3
+ ### Fixes
4
+
5
+ The Sensu API now responds to HEAD requests for GET routes.
6
+
7
+ The Sensu API now responds to unsupported HTTP request methods with a 404
8
+ (Not Found), i.e. PUT.
9
+
1
10
  ## 0.25.1 - 2016-06-14
2
11
 
3
12
  ### Fixes
@@ -172,7 +172,7 @@ module Sensu
172
172
  def respond
173
173
  @response.status = @response_status || 200
174
174
  @response.status_string = @response_status_string || "OK"
175
- if @response_content
175
+ if @response_content && @http_request_method != HEAD_METHOD
176
176
  @response.content_type "application/json"
177
177
  @response.content = Sensu::JSON.dump(@response_content)
178
178
  end
@@ -305,7 +305,7 @@ module Sensu
305
305
  def route_request
306
306
  if @http_request_method == OPTIONS_METHOD
307
307
  respond
308
- else
308
+ elsif ROUTES.has_key?(@http_request_method)
309
309
  route = ROUTES[@http_request_method].detect do |route|
310
310
  @http_request_uri =~ route[0]
311
311
  end
@@ -314,6 +314,8 @@ module Sensu
314
314
  else
315
315
  not_found!
316
316
  end
317
+ else
318
+ not_found!
317
319
  end
318
320
  end
319
321
 
@@ -24,33 +24,37 @@ module Sensu
24
24
  include Results
25
25
 
26
26
  GET_METHOD = "GET".freeze
27
+ HEAD_METHOD = "HEAD".freeze
27
28
  POST_METHOD = "POST".freeze
28
29
  DELETE_METHOD = "DELETE".freeze
29
30
  OPTIONS_METHOD = "OPTIONS".freeze
30
31
 
32
+ GET_ROUTES = [
33
+ [INFO_URI, :get_info],
34
+ [HEALTH_URI, :get_health],
35
+ [CLIENTS_URI, :get_clients],
36
+ [CLIENT_URI, :get_client],
37
+ [CLIENT_HISTORY_URI, :get_client_history],
38
+ [CHECKS_URI, :get_checks],
39
+ [CHECK_URI, :get_check],
40
+ [EVENTS_URI, :get_events],
41
+ [EVENTS_CLIENT_URI, :get_events_client],
42
+ [EVENT_URI, :get_event],
43
+ [AGGREGATES_URI, :get_aggregates],
44
+ [AGGREGATE_URI, :get_aggregate],
45
+ [AGGREGATE_CLIENTS_URI, :get_aggregate_clients],
46
+ [AGGREGATE_CHECKS_URI, :get_aggregate_checks],
47
+ [AGGREGATE_RESULTS_SEVERITY_URI, :get_aggregate_results_severity],
48
+ [STASHES_URI, :get_stashes],
49
+ [STASH_URI, :get_stash],
50
+ [RESULTS_URI, :get_results],
51
+ [RESULTS_CLIENT_URI, :get_results_client],
52
+ [RESULT_URI, :get_result]
53
+ ]
54
+
31
55
  ROUTES = {
32
- GET_METHOD => [
33
- [INFO_URI, :get_info],
34
- [HEALTH_URI, :get_health],
35
- [CLIENTS_URI, :get_clients],
36
- [CLIENT_URI, :get_client],
37
- [CLIENT_HISTORY_URI, :get_client_history],
38
- [CHECKS_URI, :get_checks],
39
- [CHECK_URI, :get_check],
40
- [EVENTS_URI, :get_events],
41
- [EVENTS_CLIENT_URI, :get_events_client],
42
- [EVENT_URI, :get_event],
43
- [AGGREGATES_URI, :get_aggregates],
44
- [AGGREGATE_URI, :get_aggregate],
45
- [AGGREGATE_CLIENTS_URI, :get_aggregate_clients],
46
- [AGGREGATE_CHECKS_URI, :get_aggregate_checks],
47
- [AGGREGATE_RESULTS_SEVERITY_URI, :get_aggregate_results_severity],
48
- [STASHES_URI, :get_stashes],
49
- [STASH_URI, :get_stash],
50
- [RESULTS_URI, :get_results],
51
- [RESULTS_CLIENT_URI, :get_results_client],
52
- [RESULT_URI, :get_result]
53
- ],
56
+ GET_METHOD => GET_ROUTES,
57
+ HEAD_METHOD => GET_ROUTES,
54
58
  POST_METHOD => [
55
59
  [CLIENTS_URI, :post_clients],
56
60
  [REQUEST_URI, :post_request],
@@ -1,7 +1,7 @@
1
1
  module Sensu
2
2
  unless defined?(Sensu::VERSION)
3
3
  # Sensu release version.
4
- VERSION = "0.25.1".freeze
4
+ VERSION = "0.25.2".freeze
5
5
 
6
6
  # Sensu check severities.
7
7
  SEVERITIES = %w[ok warning critical unknown].freeze
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.1
4
+ version: 0.25.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Porter
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-06-14 00:00:00.000000000 Z
12
+ date: 2016-06-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine