wrap_it_ruby 0.3.1 → 0.3.2

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: 7f6ed92be744074125808b44a1aa65cf1dafd00be14c8190824904841d275b6d
4
- data.tar.gz: 4d3efb23f4ffd7406fd786fd41d98f6f4cb0b2ba35c9e1fd5c43d6c7027771a3
3
+ metadata.gz: fa2cef76d046309295713f567c31c703aad9b7856b3349e9a65900f864940f90
4
+ data.tar.gz: ad16cee91fa318b565cfda5b0eececb3c85ccdfca93745704f933591a7036b89
5
5
  SHA512:
6
- metadata.gz: c7964a50fad62192b45d0e2a238217a6be39c6142f95b8710f5ad61a3f5b3bf3c4c0346f47d898908cb9ed74282f452c29c9add1c32bbefc9c1f207d91b08b3d
7
- data.tar.gz: '097445c1d52ed9248c6feff3e1606642c1087e8ae68be7a2d99cf175cecbbc6e0c0f87a70b503496a640c1cc8232a8bb100d0ad82eaac187954a726e89cb9bcb'
6
+ metadata.gz: ce33cc961a1b61b8a70fb5f8732d5e48b2442622998518d83f02cbef72e417cf7d31c9eaa369eb708e7cec6f0a33a08b8374b0d889c54688eac80074347efab7
7
+ data.tar.gz: e499fa0de180cf977f94c9c7ab800298ec3dbee57a4d375ebdb9c2940f7c24478527e13e86f101f5f462d447820cf2e7aa522d7d31ad5be4e285de2e6d0ce562
@@ -49,7 +49,9 @@
49
49
  if (!link) return
50
50
 
51
51
  const raw = link.getAttribute('href')
52
- const url = raw.startsWith('/') ? `/_proxy/${window.__proxyHost}${raw}` : rewriteUrl(raw)
52
+ const url = raw.startsWith('/_proxy/') ? raw
53
+ : raw.startsWith('/') ? `/_proxy/${window.__proxyHost}${raw}`
54
+ : rewriteUrl(raw)
53
55
 
54
56
  event.preventDefault()
55
57
  window.location.href = url
@@ -59,7 +61,9 @@
59
61
  event.preventDefault()
60
62
  const form = event.target
61
63
  const raw = form.getAttribute('action') || ''
62
- const url = raw.startsWith('/') ? `/_proxy/${window.__proxyHost}${raw}` : rewriteUrl(raw)
64
+ const url = raw.startsWith('/_proxy/') ? raw
65
+ : raw.startsWith('/') ? `/_proxy/${window.__proxyHost}${raw}`
66
+ : rewriteUrl(raw)
63
67
 
64
68
  form.setAttribute('action', url)
65
69
  event.target.submit()
@@ -160,7 +164,9 @@
160
164
  } catch {
161
165
  // Relative URL — prefix with proxy host
162
166
  if (raw.startsWith('/')) {
163
- return `wss://${window.__hostingSite}/_proxy/${PROXY_HOST}${raw}`
167
+ return raw.startsWith('/_proxy/')
168
+ ? `wss://${window.__hostingSite}${raw}`
169
+ : `wss://${window.__hostingSite}/_proxy/${PROXY_HOST}${raw}`
164
170
  }
165
171
  return raw
166
172
  }
@@ -183,7 +189,9 @@
183
189
  if (_EventSource) {
184
190
  window.EventSource = function (url, dict) {
185
191
  const raw = typeof url === 'string' ? url : url.href
186
- const rewritten = raw.startsWith('/') ? `/_proxy/${PROXY_HOST}${raw}` : rewriteUrl(raw)
192
+ const rewritten = raw.startsWith('/_proxy/') ? raw
193
+ : raw.startsWith('/') ? `/_proxy/${PROXY_HOST}${raw}`
194
+ : rewriteUrl(raw)
187
195
  return new _EventSource(rewritten, dict)
188
196
  }
189
197
  window.EventSource.prototype = _EventSource.prototype
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WrapItRuby
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wrap_it_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Kidd