zendesk_apps_tools 2.8.1 → 2.8.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
- SHA1:
3
- metadata.gz: 01bac30987b502d8ce09cd2f4097fef750a496a4
4
- data.tar.gz: 86a1e87722b4a0a26cd7e212dffa551ccf4adc7d
2
+ SHA256:
3
+ metadata.gz: 30d7150349178c7653938db858bcf4673910c370fe2ce0098210242f214c03c0
4
+ data.tar.gz: 1e23a0c5a6c64887c0feee517d6b3c057ec8ab5579b3524cb5e76598650fe490
5
5
  SHA512:
6
- metadata.gz: 33505052afc118b56f1e8fce193aa47ea9942dc7f077413163b482e649d312488dc17544890a843b42773897b3541aacd284e7e749591e2e9fe7fc8723da4b32
7
- data.tar.gz: aae7bcbefdf8de45ea3d3bc9dc99beba2b2aa9a71148c75babacec0c19c9838ad6b11adbb3432488f2a70d7abad847252a8fd006442b5eab6b53cb66f855cb0f
6
+ metadata.gz: d6940d8d0ff1870acfef98e97530e82c12a3259dbdb8072c8501182c5e77cdffb75608551ce0523245f295b8753c94b177df1536760915a4721ee7f279055bf7
7
+ data.tar.gz: 7a733aa27071cce42b0f728a1f90d5db5d2f3a05cdc8ab5dc3b6b6b8a1663a11a242417e612ac02a6bb9dd35daf4b7e47abc7a3b3da647d86adfccece5d4ea1e
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'sinatra/base'
4
+ require 'sinatra/cross_origin'
4
5
  require 'zendesk_apps_tools/theming/common'
5
6
 
6
7
  module ZendeskAppsTools
@@ -8,6 +9,8 @@ module ZendeskAppsTools
8
9
  class Server < Sinatra::Base
9
10
  include Common
10
11
 
12
+ enable :cross_origin
13
+
11
14
  get '/livereload' do
12
15
  if settings.livereload && Faye::WebSocket.websocket?(env)
13
16
  ws = Faye::WebSocket.new(env)
@@ -59,14 +62,29 @@ module ZendeskAppsTools
59
62
  end
60
63
 
61
64
  get '/guide/*' do
65
+ access_control_allow_origin
66
+
62
67
  path = File.join(app_dir, *params[:splat])
63
68
  return send_file path if File.exist?(path)
64
69
  raise Sinatra::NotFound
65
70
  end
66
71
 
72
+ # This is for any preflight request
73
+ options "*" do
74
+ access_control_allow_origin
75
+
76
+ response.headers["Allow"] = "GET, POST, OPTIONS"
77
+ response.headers["Access-Control-Allow-Headers"] = "Authorization, Content-Type, Accept, X-User-Email, X-Auth-Token"
78
+ 200
79
+ end
80
+
67
81
  def app_dir
68
82
  settings.root
69
83
  end
84
+
85
+ def access_control_allow_origin
86
+ headers 'Access-Control-Allow-Origin' => '*'
87
+ end
70
88
  end
71
89
  end
72
90
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ZendeskAppsTools
3
- VERSION = '2.8.1'
3
+ VERSION = '2.8.2'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zendesk_apps_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.1
4
+ version: 2.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James A. Rosen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-12-15 00:00:00.000000000 Z
14
+ date: 2018-01-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: thor
@@ -321,7 +321,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
321
321
  version: 1.3.6
322
322
  requirements: []
323
323
  rubyforge_project:
324
- rubygems_version: 2.6.13
324
+ rubygems_version: 2.7.3
325
325
  signing_key:
326
326
  specification_version: 4
327
327
  summary: Tools to help you develop Zendesk Apps.