requestjs-rails 0.0.10 → 0.0.11

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: 3cfa027194b10b71958ba06f76e28d181ab6df698cbe26afd29295aec86146b5
4
- data.tar.gz: 757283047d0579f8e32f8556b90e2b4e24bcda160590cd8de677ba64eb26e88e
3
+ metadata.gz: fad5960e6459e419a6a684ebc12194003f4b19f83b984004c5a62205ea761ea5
4
+ data.tar.gz: 1f1d45bd1e64fda7a075641e00fd78a97f84606ee0843b3663be143a9896295f
5
5
  SHA512:
6
- metadata.gz: 9c12ab260f0c0a403c2c2666e35386f72c7637e5c33d71a312bf335ad02c90a261b544b211c3b30bdf06ba19fed84a458e77ac8cadb165482d4e44f7bc03b0fa
7
- data.tar.gz: c0c5a9d7c6cb5963626672fe2866112fce7a75e11c6baf4edb942d27ff507a23499fda5d3d2f553d942b417ba65ab047ccebac449fbb8357110313de37ed8f54
6
+ metadata.gz: a55c0defd7b2890825932f7d53f01d6d6388bc4ce8c8bf4949da772a4e4bb8712a4378feae12c0fb75fb1afc3b8221ae32f60ace6f373533cbe962298978eb60
7
+ data.tar.gz: a5eb76765f8a41f810d65dc2742138191b37ab7e3bf5bc561cbcd5f706cb3791cc5ca211e4c1be761e2b400fdb5007cd0fcfd0e32088792f05f436e9a1d476ef
@@ -133,7 +133,8 @@ class FetchRequest {
133
133
  if (response.unauthenticated && response.authenticationURL) {
134
134
  return Promise.reject(window.location.href = response.authenticationURL);
135
135
  }
136
- if (response.ok && response.isTurboStream) {
136
+ const responseStatusIsTurboStreamable = response.ok || response.unprocessableEntity;
137
+ if (responseStatusIsTurboStreamable && response.isTurboStream) {
137
138
  await response.renderTurboStream();
138
139
  }
139
140
  return response;
@@ -159,7 +160,7 @@ class FetchRequest {
159
160
  headers: this.headers,
160
161
  body: this.formattedBody,
161
162
  signal: this.signal,
162
- credentials: "same-origin",
163
+ credentials: this.credentials,
163
164
  redirect: this.redirect
164
165
  };
165
166
  }
@@ -232,6 +233,9 @@ class FetchRequest {
232
233
  get redirect() {
233
234
  return this.options.redirect || "follow";
234
235
  }
236
+ get credentials() {
237
+ return this.options.credentials || "same-origin";
238
+ }
235
239
  get additionalHeaders() {
236
240
  return this.options.headers || {};
237
241
  }
@@ -1,3 +1,3 @@
1
1
  module Requestjs
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
metadata CHANGED
@@ -1,30 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: requestjs-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcelo Lauxen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-15 00:00:00.000000000 Z
11
+ date: 2023-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
14
+ name: railties
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 6.0.0
19
+ version: 6.1.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 6.0.0
27
- description:
26
+ version: 6.1.0
27
+ description:
28
28
  email: marcelolauxen16@gmail.com
29
29
  executables: []
30
30
  extensions: []
@@ -46,7 +46,7 @@ homepage: https://github.com/marcelolx/requestjs-rails
46
46
  licenses:
47
47
  - MIT
48
48
  metadata: {}
49
- post_install_message:
49
+ post_install_message:
50
50
  rdoc_options: []
51
51
  require_paths:
52
52
  - lib
@@ -61,8 +61,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  requirements: []
64
- rubygems_version: 3.1.6
65
- signing_key:
64
+ rubygems_version: 3.4.19
65
+ signing_key:
66
66
  specification_version: 4
67
67
  summary: A tiny Fetch API wrapper that allows you to make http requests without need
68
68
  to handle to send the CSRF Token on every request