riddl 0.107 → 0.108

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
  SHA256:
3
- metadata.gz: d9014ecb35737c5bbfbcc674048e91b36777c36079cd39250e315df00202fb79
4
- data.tar.gz: aedc7395bd249211301683be78928f9c643c67f74a144e811892ccf5fb0a6a89
3
+ metadata.gz: ba99e4436e3ca77f2ccd22e783ced04c42b84a2a3a90e5dc767b3912a0fe15b5
4
+ data.tar.gz: e6b7abac2cd99448e958a61748b2e16c39896747fb4011921ca67f2b53ac6ae1
5
5
  SHA512:
6
- metadata.gz: 42fa22296d28be1e6ede7adf5f386df5eb465516e7bfd0897a54e15891f9b524294f7f2b5283fc8bbb242dacb6916364bc87d96e143f1ac13d672d15e0d207bd
7
- data.tar.gz: 5ee9ba1fd8f34c624bdca9f6e868f5ae682baffc782a9577e4cf65cd146d29e93b7122f3a0c81eef5ebd5d506ba834f0c407b14b1581509f982d522407ff84c4
6
+ metadata.gz: 3855116333b18322255d788c92e3003c37813167266d24d15ca4d048113b4c57014c5eb8d8048e8492679a42f585bc86dcd04aee0d60982a135d4a4761adf946
7
+ data.tar.gz: c81120e0746794963fbe8c59498eb5fe15330c63149144a3800d6477402b7b41d88b710786ddf55b266737933a07737cd3f537a622d1533e1e09d45907161149
@@ -10,6 +10,8 @@ end
10
10
 
11
11
  class Echo < Riddl::SSEImplementation
12
12
  def onopen
13
+ // if true (or any object for that matter) is returned, then 200 is sent
14
+ // if false (or nil) is returned 404, the sse is denied
13
15
  puts "Connection established"
14
16
  Thread.new do
15
17
  1.upto 10 do |i|
@@ -56,8 +56,12 @@ module Riddl
56
56
  headers['Access-Control-Max-Age'] = '0'
57
57
  end
58
58
  EventMachine::next_tick {
59
- @env['async.callback'].call [200, headers, @body]
60
- trigger_on_open
59
+ if trigger_on_open
60
+ @env['async.callback'].call [200, headers, @body]
61
+ else
62
+ @body.fail
63
+ @env['async.callback'].call [404, headers, {}]
64
+ end
61
65
  }
62
66
  end
63
67
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "riddl"
3
- s.version = "0.107"
3
+ s.version = "0.108"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0"
6
6
  s.summary = "restful interface description and declaration language: tools and client/server libs"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riddl
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.107'
4
+ version: '0.108'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen 'eTM' Mangler
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: tools
12
12
  cert_chain: []
13
- date: 2020-10-22 00:00:00.000000000 Z
13
+ date: 2020-10-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: daemonite