pg_rails 7.6.30 → 7.6.31

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: 02fec9c121e284ea6ad059dc7f04d29166f622e8bb52e803646a1c806ef6a1c6
4
- data.tar.gz: b0aace6af7ac7454e0695f27bea869c6c6416d6a5d16310818239eda4efd21eb
3
+ metadata.gz: 0b315989e816d61e3a75b72845fc50ab94b4393b538f208c43cfcd6ff078a9bf
4
+ data.tar.gz: 66b62128b94690c25f37213bc6f4b2958b2218c3d001ae2f1a664f694dfe0efc
5
5
  SHA512:
6
- metadata.gz: 23c6c66f106c56ea1e6c426e0ef55c1ba09486fc7092ad98876933c77dc83fcc0e83f15868678c6e25e7f3a955071c251d8d18ec80b8f948a9e039d8a463fcfd
7
- data.tar.gz: fcfce082512699a846d870928335a0732eccafac7a870613ebb4347422915dbc447656fbc6c512d1cbc08232933e0cdecd2ff8719810f51a05b5d9a644a9083d
6
+ metadata.gz: b1092c6d4cceb0201e86b490124eebab80d3303da02e01c26f185ccaab629950d7f5c6ac069904079e3e243987a9e09d743a778dd207328d4a6033db71e3a95e
7
+ data.tar.gz: 94f283edbc6474c4fffcec0045e66af213e3ac698e5f4ba1293a9d373892651ffaec3ba54600d0e0e5352358b704eda07452a9d9791f6119194f3158e46aa58c
@@ -2,6 +2,7 @@
2
2
 
3
3
  module PgEngine
4
4
  # rubocop:disable Rails/ApplicationController
5
+ # rubocop:disable Metrics/ClassLength
5
6
  class BaseController < ActionController::Base
6
7
  # Importante que esta línea esté al principio
7
8
  protect_from_forgery with: :exception
@@ -118,6 +119,26 @@ module PgEngine
118
119
  end
119
120
 
120
121
  def page_not_found
122
+ # Skip CSRF verification, given that the resource is missing
123
+ @_marked_for_same_origin_verification = false
124
+
125
+ # Mor about ActionController::InvalidCrossOriginRequest CORS CSRF
126
+ #
127
+ # actionpack/lib/action_controller/metal/request_forgery_protection.rb
128
+ #
129
+ # def verify_same_origin_request # :doc:
130
+ # if marked_for_same_origin_verification? && non_xhr_javascript_response?
131
+ # if logger && log_warning_on_csrf_failure
132
+ # logger.warn CROSS_ORIGIN_JAVASCRIPT_WARNING
133
+ # end
134
+ # raise ActionController::InvalidCrossOriginRequest, CROSS_ORIGIN_JAVASCRIPT_WARNING
135
+ # end
136
+ # end
137
+ #
138
+ # no entiendo el sentido de ese código, porque no chequea realmente el
139
+ # origin del request. simplemente tira la exception si está enviando un
140
+ # javascript que no sea XHR (XMLHTTPRequest)
141
+
121
142
  render_my_component(PageNotFoundComponent.new, :not_found)
122
143
  end
123
144
 
@@ -200,6 +221,7 @@ module PgEngine
200
221
  render json: { html: }, status:
201
222
  end
202
223
 
224
+ # Mainly JS
203
225
  format.any do
204
226
  head status
205
227
  end
@@ -221,4 +243,5 @@ module PgEngine
221
243
  redirect_back fallback_location: root_path
222
244
  end
223
245
  end
246
+ # rubocop:enable Metrics/ClassLength
224
247
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  # :nocov:
4
4
  module PgRails
5
- VERSION = '7.6.30'
5
+ VERSION = '7.6.31'
6
6
  end
7
7
  # :nocov:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.6.30
4
+ version: 7.6.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-05 00:00:00.000000000 Z
11
+ date: 2025-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails