web47core 3.2.3.14 → 3.2.3.15
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 +4 -4
- data/app/controllers/errors_controller.rb +16 -0
- data/lib/web47core/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a0caf08ce39f250131aa035b33f0661a4bddee995a1ff900f92182efc1ca1b4c
|
|
4
|
+
data.tar.gz: c43f9ba346f3e6ef08213377b9a91b41cb4a8aa4a51ad877ae7e0ad6d531540d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d69e9a7b40859efd7134e7dd82daf3fb23728b3c7122dcd1f8678ca03b0a4e67fc08db22ab4e2d02161d2ba80a23bb5380c937bfad4d8741724fe8ddfee094a2
|
|
7
|
+
data.tar.gz: 764604776ae06e34a16291d3cf66e168f9b26156a3db5816a8b1bcd1c42ac95e51e7f32b9a03580326f684462932ccd72202c54eebb61a9e51b0f6cfd91f5802
|
|
@@ -3,10 +3,26 @@
|
|
|
3
3
|
# with no extra checks for CSRF,authentication, layouts or the ilk. Just say, no, go away!
|
|
4
4
|
class ErrorsController < ActionController::Base
|
|
5
5
|
# No CSRF/layout/filters; keep it cheap
|
|
6
|
+
skip_authorization_check if respond_to?(:skip_authorization_check)
|
|
7
|
+
skip_forgery_protection
|
|
8
|
+
|
|
9
|
+
# @abstract Quietly return a 410 Gone and go away, dont report this
|
|
6
10
|
def not_found
|
|
7
11
|
if defined?(NewRelic) && defined?(NewRelic::Agent)
|
|
8
12
|
NewRelic::Agent.ignore_transaction
|
|
9
13
|
end
|
|
10
14
|
head :gone # 410 Gone is used here to indicate that the resource has been intentionally and permanently removed, and clients should not expect it to be available again. This is stronger than the standard 404 Not Found, which is used when the resource may be available in the future.
|
|
11
15
|
end
|
|
16
|
+
|
|
17
|
+
# @abstract Quietly return 204 for OPTIONS (preflight)
|
|
18
|
+
def preflight
|
|
19
|
+
if defined?(NewRelic) && defined?(NewRelic::Agent)
|
|
20
|
+
NewRelic::Agent.ignore_transaction
|
|
21
|
+
end
|
|
22
|
+
# Add CORS headers if you normally set them (optional)
|
|
23
|
+
# response.set_header('Access-Control-Allow-Origin', '*')
|
|
24
|
+
# response.set_header('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE, OPTIONS')
|
|
25
|
+
# response.set_header('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-Requested-With')
|
|
26
|
+
head :no_content
|
|
27
|
+
end
|
|
12
28
|
end
|
data/lib/web47core/version.rb
CHANGED