rack-mini-profiler 1.1.4 → 1.1.5
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/CHANGELOG.md +6 -0
- data/lib/html/includes.js +19 -16
- data/lib/html/includes.tmpl +1 -1
- data/lib/html/vendor.js +1 -1
- data/lib/mini_profiler/asset_version.rb +1 -1
- data/lib/mini_profiler/client_settings.rb +10 -3
- data/lib/mini_profiler/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 293023dd85ac18a9da819b665e1965ff2f4c6e0910b50c22b75a6b52a7b8ab75
|
4
|
+
data.tar.gz: 514b51f165105a9d67d29119b541fa483b5c1a4f2aac4f24c06b8d0e09bf48d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af932928ecc8e2861db979ca4f9df62229de5589cbfaf37c556a5430ee98bbe941b95ba09603e7112028c75b87015b785394add2952673b9e430cbc24ea3afa8
|
7
|
+
data.tar.gz: 7355306f0f0b809b589ff50dfb1774a57d0cc9bd4229bd1d1b2fae95a9693508093f5f4426cef6154062dba39c5824037742fd35fc615872fb15144367be9e56
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 1.1.5 - 2020-01-28
|
4
|
+
|
5
|
+
- [FIX] correct custom counter regression
|
6
|
+
- [FIX] respect max_traces_to_show
|
7
|
+
- [FIX] handle storage engine failures in whitelist mode
|
8
|
+
|
3
9
|
## 1.1.4 - 2019-12-12
|
4
10
|
|
5
11
|
- [SECURITY] carefully crafted SQL could cause an XSS on sites that do not use CSPs
|
data/lib/html/includes.js
CHANGED
@@ -79,20 +79,6 @@ var MiniProfiler = (function() {
|
|
79
79
|
return localStorage[getVersionedKey(keyPrefix)];
|
80
80
|
};
|
81
81
|
|
82
|
-
var compileTemplates = function compileTemplates(data) {
|
83
|
-
var element = document.createElement("DIV");
|
84
|
-
element.innerHTML = data;
|
85
|
-
var templates = {};
|
86
|
-
var children = element.children;
|
87
|
-
|
88
|
-
for (var i = 0; i < children.length; i++) {
|
89
|
-
var child = children[i];
|
90
|
-
templates[child.id] = doT.compile(child.innerHTML);
|
91
|
-
}
|
92
|
-
|
93
|
-
MiniProfiler.templates = templates;
|
94
|
-
};
|
95
|
-
|
96
82
|
var getClientPerformance = function getClientPerformance() {
|
97
83
|
return window.performance === null ? null : window.performance;
|
98
84
|
};
|
@@ -284,7 +270,7 @@ var MiniProfiler = (function() {
|
|
284
270
|
}); // limit count
|
285
271
|
|
286
272
|
if (
|
287
|
-
container.
|
273
|
+
container.querySelectorAll(".profiler-result").length >
|
288
274
|
options.maxTracesToShow
|
289
275
|
) {
|
290
276
|
var elem = container.querySelector(".profiler-result");
|
@@ -746,7 +732,24 @@ var MiniProfiler = (function() {
|
|
746
732
|
XMLHttpRequest.prototype.send = function(data) {
|
747
733
|
ajaxStartTime = new Date();
|
748
734
|
this.addEventListener("load", function() {
|
749
|
-
//
|
735
|
+
// responseURL isn't available in IE11
|
736
|
+
if (
|
737
|
+
this.responseURL &&
|
738
|
+
this.responseURL.indexOf(window.location.origin) !== 0
|
739
|
+
) {
|
740
|
+
return;
|
741
|
+
}
|
742
|
+
// getAllResponseHeaders isn't available in Edge.
|
743
|
+
var allHeaders = this.getAllResponseHeaders
|
744
|
+
? this.getAllResponseHeaders()
|
745
|
+
: null;
|
746
|
+
if (
|
747
|
+
allHeaders &&
|
748
|
+
allHeaders.toLowerCase().indexOf("x-miniprofiler-ids") === -1
|
749
|
+
) {
|
750
|
+
return;
|
751
|
+
}
|
752
|
+
// should be a string of comma-separated ids
|
750
753
|
var stringIds = this.getResponseHeader("X-MiniProfiler-Ids");
|
751
754
|
|
752
755
|
if (stringIds) {
|
data/lib/html/includes.tmpl
CHANGED
@@ -181,7 +181,7 @@
|
|
181
181
|
|
182
182
|
{{? it.timing.has_children}}
|
183
183
|
{{~ it.timing.children :value}}
|
184
|
-
{{= MiniProfiler.templates.timingTemplate({timing: value, page: it}) }}
|
184
|
+
{{= MiniProfiler.templates.timingTemplate({timing: value, page: it.page}) }}
|
185
185
|
{{~}}
|
186
186
|
{{?}}
|
187
187
|
</script>
|
data/lib/html/vendor.js
CHANGED
@@ -15,7 +15,7 @@ var out=' <a href="'+( MiniProfiler.shareUrl(it.page.id) )+'" class="profiler-sh
|
|
15
15
|
}
|
16
16
|
MiniProfiler.templates["timingTemplate"] = function anonymous(it
|
17
17
|
) {
|
18
|
-
var out=' <tr class="';if(it.timing.is_trivial){out+='profiler-trivial';}out+='" data-timing-id="'+( it.timing.id )+'"> <td class="profiler-label" title="';if(it.timing.name && it.timing.name.length > 45){out+=''+( it.timing.name );}out+='"> <span class="profiler-indent">'+( MiniProfiler.renderIndent(it.timing.depth) )+'</span> '+( it.timing.name.slice(0,45) );if(it.timing.name && it.timing.name.length > 45){out+='...';}out+=' </td> <td class="profiler-duration" title="duration of this step without any children\'s durations"> '+( MiniProfiler.formatDuration(it.timing.duration_without_children_milliseconds) )+' </td> <td class="profiler-duration profiler-duration-with-children" title="duration of this step and its children"> '+( MiniProfiler.formatDuration(it.timing.duration_milliseconds) )+' </td> <td class="profiler-duration time-from-start" title="time elapsed since profiling started"> <span class="profiler-unit">+</span>'+( MiniProfiler.formatDuration(it.timing.start_milliseconds) )+' </td> ';if(it.timing.has_sql_timings){out+=' <td class="profiler-duration ';if(it.timing.has_duplicate_sql_timings){out+='profiler-warning';}out+='" title="';if(it.timing.has_duplicate_sql_timings){out+='duplicate queries detected - ';}if(it.timing.executed_readers > 0 || it.timing.executed_scalars > 0 || it.timing.executed_non_queries > 0){out+=''+( it.timing.executed_readers )+' reader, '+( it.timing.executed_scalars )+' scalar, '+( it.timing.executed_non_queries )+' non-query statements executed';}out+='"> <a class="profiler-queries-show"> ';if(it.timing.has_duplicate_sql_timings){out+='<span class="profiler-nuclear">!</span>';}out+=' '+( it.timing.sql_timings.length )+' <span class="profiler-unit">sql</span> </a> </td> <td class="profiler-duration" title="aggregate duration of all queries in this step (excludes children)"> '+( MiniProfiler.formatDuration(it.timing.sql_timings_duration_milliseconds) )+' </td> ';}else{out+=' <td colspan="2"></td> ';}out+=' ';var arr1=it.page.custom_timing_names;if(arr1){var value,i1=-1,l1=arr1.length-1;while(i1<l1){value=arr1[i1+=1];out+=' ';if(it.timing.custom_timings && it.timing.custom_timings[value]){out+=' <td class="profiler-duration" title="aggregate number of all '+( value.toLowerCase() )+' invocations in this step (excludes children)"> '+( it.timing.custom_timings[value].length )+' '+( value.toLowerCase() )+' </td> <td class="profiler-duration" title="aggregate duration of all '+( value.toLowerCase() )+' invocations in this step (excludes children)"> '+( MiniProfiler.formatDuration(it.timing.custom_timing_stats[value].duration) )+' </td> ';}else{out+=' <td colspan="2"></td> ';}out+=' ';} } out+=' </tr> ';if(it.timing.has_children){out+=' ';var arr2=it.timing.children;if(arr2){var value,i2=-1,l2=arr2.length-1;while(i2<l2){value=arr2[i2+=1];out+=' '+( MiniProfiler.templates.timingTemplate({timing: value, page: it}) )+' ';} } out+=' ';}return out;
|
18
|
+
var out=' <tr class="';if(it.timing.is_trivial){out+='profiler-trivial';}out+='" data-timing-id="'+( it.timing.id )+'"> <td class="profiler-label" title="';if(it.timing.name && it.timing.name.length > 45){out+=''+( it.timing.name );}out+='"> <span class="profiler-indent">'+( MiniProfiler.renderIndent(it.timing.depth) )+'</span> '+( it.timing.name.slice(0,45) );if(it.timing.name && it.timing.name.length > 45){out+='...';}out+=' </td> <td class="profiler-duration" title="duration of this step without any children\'s durations"> '+( MiniProfiler.formatDuration(it.timing.duration_without_children_milliseconds) )+' </td> <td class="profiler-duration profiler-duration-with-children" title="duration of this step and its children"> '+( MiniProfiler.formatDuration(it.timing.duration_milliseconds) )+' </td> <td class="profiler-duration time-from-start" title="time elapsed since profiling started"> <span class="profiler-unit">+</span>'+( MiniProfiler.formatDuration(it.timing.start_milliseconds) )+' </td> ';if(it.timing.has_sql_timings){out+=' <td class="profiler-duration ';if(it.timing.has_duplicate_sql_timings){out+='profiler-warning';}out+='" title="';if(it.timing.has_duplicate_sql_timings){out+='duplicate queries detected - ';}if(it.timing.executed_readers > 0 || it.timing.executed_scalars > 0 || it.timing.executed_non_queries > 0){out+=''+( it.timing.executed_readers )+' reader, '+( it.timing.executed_scalars )+' scalar, '+( it.timing.executed_non_queries )+' non-query statements executed';}out+='"> <a class="profiler-queries-show"> ';if(it.timing.has_duplicate_sql_timings){out+='<span class="profiler-nuclear">!</span>';}out+=' '+( it.timing.sql_timings.length )+' <span class="profiler-unit">sql</span> </a> </td> <td class="profiler-duration" title="aggregate duration of all queries in this step (excludes children)"> '+( MiniProfiler.formatDuration(it.timing.sql_timings_duration_milliseconds) )+' </td> ';}else{out+=' <td colspan="2"></td> ';}out+=' ';var arr1=it.page.custom_timing_names;if(arr1){var value,i1=-1,l1=arr1.length-1;while(i1<l1){value=arr1[i1+=1];out+=' ';if(it.timing.custom_timings && it.timing.custom_timings[value]){out+=' <td class="profiler-duration" title="aggregate number of all '+( value.toLowerCase() )+' invocations in this step (excludes children)"> '+( it.timing.custom_timings[value].length )+' '+( value.toLowerCase() )+' </td> <td class="profiler-duration" title="aggregate duration of all '+( value.toLowerCase() )+' invocations in this step (excludes children)"> '+( MiniProfiler.formatDuration(it.timing.custom_timing_stats[value].duration) )+' </td> ';}else{out+=' <td colspan="2"></td> ';}out+=' ';} } out+=' </tr> ';if(it.timing.has_children){out+=' ';var arr2=it.timing.children;if(arr2){var value,i2=-1,l2=arr2.length-1;while(i2<l2){value=arr2[i2+=1];out+=' '+( MiniProfiler.templates.timingTemplate({timing: value, page: it.page}) )+' ';} } out+=' ';}return out;
|
19
19
|
}
|
20
20
|
MiniProfiler.templates["sqlTimingTemplate"] = function anonymous(it
|
21
21
|
) {
|
@@ -89,10 +89,17 @@ module Rack
|
|
89
89
|
def has_valid_cookie?
|
90
90
|
valid_cookie = !@cookie.nil?
|
91
91
|
|
92
|
-
if (MiniProfiler.config.authorization_mode == :whitelist)
|
93
|
-
|
92
|
+
if (MiniProfiler.config.authorization_mode == :whitelist) && valid_cookie
|
93
|
+
begin
|
94
|
+
@allowed_tokens ||= @store.allowed_tokens
|
95
|
+
rescue => e
|
96
|
+
if @config.storage_failure != nil
|
97
|
+
@config.storage_failure.call(e)
|
98
|
+
end
|
99
|
+
end
|
94
100
|
|
95
|
-
valid_cookie =
|
101
|
+
valid_cookie = @allowed_tokens &&
|
102
|
+
(Array === @orig_auth_tokens) &&
|
96
103
|
((@allowed_tokens & @orig_auth_tokens).length > 0)
|
97
104
|
end
|
98
105
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-mini-profiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Saffron
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2020-01-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|