requestjs-rails 0.0.12 → 0.0.13

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: 20cef8fde0fc81345d4531747a97e20a7b14a74cbc30cbf91777d9e1bb34f1fa
4
- data.tar.gz: 0ff9c29c05b34c81f9e0a24a05f6e53830095e3e93c45baaf9f0c220d72819dc
3
+ metadata.gz: a452d308a3c2a875b8aac295997c789ba97655aed5b3bd3d28075b12cd494170
4
+ data.tar.gz: b39226e61c2eec6f162a21963ac8a06fa2e800f7232aa8430e16b72a5d6759c2
5
5
  SHA512:
6
- metadata.gz: 41b0ab104a2dfc9061c2d40a9adf3530db9f2004a5f3997de9c270ebe82caa8a03e87304cdaaddae71fd82a98359043d81b5fe6799a3a79fc1fd668ec2344abc
7
- data.tar.gz: e6ce7d0d1bd2fbd31494f0e5eefb6272a05aeb30280c877dfdf4ff4a1add6aadf3be553d665c0584837db8ebfbfc741df96af2b6ed9ceb417e2532f6f5b2fd49
6
+ metadata.gz: 16e03876315812f4506c41d2e65329a4f169d57bd290ecdc301424e7d4bcbc5e3387ed9669be12682bc0147940baa3e9073be3ff231c4f490d780d529635907e
7
+ data.tar.gz: '0418aac7b2ee58548edd735bf9b76b7714bcddcca7417e4e19ab5b37dbe23d6283f8556ee84717ac6d7f37bbfb634d7e3134ea7ad87cffff45ab95b348f7fe5f'
@@ -63,9 +63,11 @@ class FetchResponse {
63
63
  if (this.isScript) {
64
64
  const script = document.createElement("script");
65
65
  const metaTag = document.querySelector("meta[name=csp-nonce]");
66
- const nonce = metaTag && metaTag.content;
67
- if (nonce) {
68
- script.setAttribute("nonce", nonce);
66
+ if (metaTag) {
67
+ const nonce = metaTag.nonce === "" ? metaTag.content : metaTag.nonce;
68
+ if (nonce) {
69
+ script.setAttribute("nonce", nonce);
70
+ }
69
71
  }
70
72
  script.innerHTML = await this.text;
71
73
  document.body.appendChild(script);
@@ -166,7 +168,7 @@ class FetchRequest {
166
168
  this.options.headers = headers;
167
169
  }
168
170
  sameHostname() {
169
- if (!this.originalUrl.startsWith("http:")) {
171
+ if (!this.originalUrl.startsWith("http:") && !this.originalUrl.startsWith("https:")) {
170
172
  return true;
171
173
  }
172
174
  try {
@@ -182,7 +184,8 @@ class FetchRequest {
182
184
  body: this.formattedBody,
183
185
  signal: this.signal,
184
186
  credentials: this.credentials,
185
- redirect: this.redirect
187
+ redirect: this.redirect,
188
+ keepalive: this.keepalive
186
189
  };
187
190
  }
188
191
  get headers() {
@@ -260,6 +263,9 @@ class FetchRequest {
260
263
  get credentials() {
261
264
  return this.options.credentials || "same-origin";
262
265
  }
266
+ get keepalive() {
267
+ return this.options.keepalive || false;
268
+ }
263
269
  get additionalHeaders() {
264
270
  return this.options.headers || {};
265
271
  }
@@ -1,3 +1,3 @@
1
1
  module Requestjs
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: requestjs-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcelo Lauxen
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-09-03 00:00:00.000000000 Z
10
+ date: 2025-04-30 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: railties
@@ -16,15 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: 6.1.0
18
+ version: 7.1.0
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: 6.1.0
27
- description:
25
+ version: 7.1.0
28
26
  email: marcelolauxen16@gmail.com
29
27
  executables: []
30
28
  extensions: []
@@ -46,7 +44,6 @@ homepage: https://github.com/marcelolx/requestjs-rails
46
44
  licenses:
47
45
  - MIT
48
46
  metadata: {}
49
- post_install_message:
50
47
  rdoc_options: []
51
48
  require_paths:
52
49
  - lib
@@ -61,8 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
58
  - !ruby/object:Gem::Version
62
59
  version: '0'
63
60
  requirements: []
64
- rubygems_version: 3.5.3
65
- signing_key:
61
+ rubygems_version: 3.6.2
66
62
  specification_version: 4
67
63
  summary: A tiny Fetch API wrapper that allows you to make http requests without need
68
64
  to handle to send the CSRF Token on every request