Skip to content

Commit 6ecd4ed

Browse files
Merge pull request #98 from marcdemz/origin/bug/RT-4457
RT-4457 Update EnvironmentDetail.cs
2 parents 9de8b81 + 6b42245 commit 6ecd4ed

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Src/StackifyLib/Models/EnvironmentDetail.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public static string GetDeviceName()
129129
}
130130
}
131131

132-
return deviceName;
132+
return deviceName.Substring(0, deviceName.Length > 60 ? 60 : deviceName.Length);
133133
}
134134

135135
public static string GetEC2InstanceId()
@@ -215,7 +215,7 @@ public static string GetDeviceName()
215215
}
216216
}
217217

218-
return deviceName;
218+
return deviceName.Substring(0, deviceName.Length > 60 ? 60 : deviceName.Length);
219219
}
220220

221221
public static async Task<string> GetEC2InstanceId()
@@ -233,6 +233,11 @@ public static async Task<string> GetEC2InstanceId()
233233
{
234234
string id = await content.Content.ReadAsStringAsync();
235235
r = string.IsNullOrWhiteSpace(id) ? null : id;
236+
237+
if (r.Contains("html"))
238+
{
239+
r = Environment.MachineName;
240+
}
236241
}
237242

238243
}

0 commit comments

Comments
 (0)