Skip to content

Commit 6520947

Browse files
committed
Fix database attributes bug
1 parent 1c4ba5f commit 6520947

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Protest/Database/AttributesJsonConverter.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ public override void Write(Utf8JsonWriter writer, ConcurrentDictionary<string, D
6464
writer.WriteStartObject();
6565

6666
foreach (KeyValuePair<string, Database.Attribute> pair in value) {
67-
writer.WritePropertyName(pair.Key);
67+
string key = pair.Key.ToLower();
68+
writer.WritePropertyName(key);
6869

6970
writer.WriteStartObject();
70-
writer.WriteString(_v, pair.Key.Contains("password") && ignorePasswords ? String.Empty : pair.Value.value);
71+
writer.WriteString(_v, key.Contains("password") && ignorePasswords ? String.Empty : pair.Value.value);
7172
writer.WriteString(_o, pair.Value.origin);
7273
writer.WriteNumber(_d, pair.Value.date);
7374
writer.WriteEndObject();

Protest/Front/deviceview.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ class DeviceView extends View {
12991299
let obj = {};
13001300
for (let i=0; i<this.attributes.childNodes.length; i++) {
13011301
if (this.attributes.childNodes[i].childNodes.length < 2) continue;
1302-
let name = this.attributes.childNodes[i].childNodes[0].value;
1302+
let name = this.attributes.childNodes[i].childNodes[0].value.toLowerCase();
13031303
let value = this.attributes.childNodes[i].childNodes[1].firstChild.value;
13041304
obj[name] = {v:value};
13051305
}

Protest/Front/userview.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class UserView extends View {
211211
let obj = {};
212212
for (let i = 0; i < this.attributes.childNodes.length; i++) {
213213
if (this.attributes.childNodes[i].childNodes.length < 2) continue;
214-
let name = this.attributes.childNodes[i].childNodes[0].value;
214+
let name = this.attributes.childNodes[i].childNodes[0].value.toLowerCase();
215215
let value = this.attributes.childNodes[i].childNodes[1].firstChild.value;
216216
obj[name] = { v: value };
217217
}

0 commit comments

Comments
 (0)