pixl-server-storage 3.0.14 → 3.0.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/storage.js +6 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixl-server-storage",
3
- "version": "3.0.14",
3
+ "version": "3.0.15",
4
4
  "description": "A key/value/list storage component for the pixl-server framework.",
5
5
  "author": "Joseph Huckaby <jhuckaby@gmail.com>",
6
6
  "homepage": "https://github.com/jhuckaby/pixl-server-storage",
package/storage.js CHANGED
@@ -34,7 +34,8 @@ module.exports = Class.create({
34
34
  },
35
35
  max_recent_events: 0,
36
36
  cache_key_match: '',
37
- expiration_updates: false
37
+ expiration_updates: false,
38
+ lower_case_keys: true
38
39
  },
39
40
 
40
41
  locks: null,
@@ -130,6 +131,7 @@ module.exports = Class.create({
130
131
  this.logEventTypes = this.config.get('log_event_types');
131
132
  this.maxRecentEvents = this.config.get('max_recent_events');
132
133
  this.expHash = this.config.get('expiration_updates');
134
+ this.lowerKeys = this.config.get('lower_case_keys');
133
135
 
134
136
  this.cacheKeyRegex = null;
135
137
  if (this.config.get('cache_key_match')) {
@@ -139,7 +141,9 @@ module.exports = Class.create({
139
141
 
140
142
  normalizeKey: function(key) {
141
143
  // downconvert unicode, lower-case, alphanum-dash-dot-slash only, strip leading and trailing slashes
142
- return unidecode(key).toLowerCase().replace(/[^\w\-\.\/]+/g, '').replace(/\/+/g, '/').replace(/^\//, '').replace(/\/$/, '');
144
+ key = '' + key;
145
+ if (this.lowerKeys) key = key.toLowerCase();
146
+ return unidecode(key).replace(/[^\w\-\.\/]+/g, '').replace(/\/+/g, '/').replace(/^\//, '').replace(/\/$/, '');
143
147
  },
144
148
 
145
149
  isBinaryKey: function(key) {