Fix tiny warning
This commit is contained in:
parent
0a60a82b8c
commit
c4c8f6164b
2
.github/workflows/dotnetcore.yml
vendored
2
.github/workflows/dotnetcore.yml
vendored
@ -45,7 +45,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ steps.create_deb.outputs.builddaterelease }}
|
||||
release_name: Nightly from master
|
||||
release_name: Nightly from ${{ steps.create_deb.outputs.builddaterelease }}
|
||||
body: This is a nightly release. It may be not working properly.
|
||||
draft: false
|
||||
prerelease: true
|
||||
|
@ -44,7 +44,7 @@ namespace Fraunhofer.Fit.IoT.LoraMap.Model.Admin {
|
||||
cont.Request.InputStream.Close();
|
||||
reader.Close();
|
||||
try {
|
||||
JsonMapper.ToObject(rawData);
|
||||
_ = JsonMapper.ToObject(rawData);
|
||||
} catch (Exception) {
|
||||
Helper.WriteError("501 - Error recieving " + filename + ", no valid json " + cont.Request.Url.PathAndQuery);
|
||||
cont.Response.StatusCode = 501;
|
||||
@ -74,7 +74,7 @@ namespace Fraunhofer.Fit.IoT.LoraMap.Model.Admin {
|
||||
private Boolean Login(HttpListenerContext cont) {
|
||||
Dictionary<String, String> POST = Webserver.GetPostParams(cont.Request);
|
||||
if(POST.ContainsKey("user") && POST["user"] == this.settings["admin_user"] && POST.ContainsKey("pass") && POST["pass"] == this.settings["admin_pass"]) {
|
||||
Int64 sessionid = 0;
|
||||
Int64 sessionid;
|
||||
while(true) {
|
||||
sessionid = AdminSession.GetRandomSessionid();
|
||||
if(!this.session.ContainsKey(sessionid)) {
|
||||
@ -110,22 +110,24 @@ namespace Fraunhofer.Fit.IoT.LoraMap.Model.Admin {
|
||||
|
||||
private Boolean CheckAuth(HttpListenerContext cont) {
|
||||
#if DEBUG
|
||||
Helper.WriteError("200 - AUTH-Bypassed!");
|
||||
return true;
|
||||
#endif
|
||||
if(cont.Request.Url.PathAndQuery.StartsWith("/admin/login.html")) {
|
||||
return true;
|
||||
} else {
|
||||
if(cont.Request.Cookies["loramapsession"] != null) {
|
||||
if(Int64.TryParse(cont.Request.Cookies["loramapsession"].Value, out Int64 sessionid)) {
|
||||
if(this.session.ContainsKey(sessionid)) {
|
||||
return this.session[sessionid].IsLoggedin;
|
||||
#else
|
||||
if(cont.Request.Url.PathAndQuery.StartsWith("/admin/login.html")) {
|
||||
return true;
|
||||
} else {
|
||||
if(cont.Request.Cookies["loramapsession"] != null) {
|
||||
if(Int64.TryParse(cont.Request.Cookies["loramapsession"].Value, out Int64 sessionid)) {
|
||||
if(this.session.ContainsKey(sessionid)) {
|
||||
return this.session[sessionid].IsLoggedin;
|
||||
}
|
||||
}
|
||||
}
|
||||
cont.Response.StatusCode = 403;
|
||||
Helper.WriteError("403 - " + cont.Request.Url.PathAndQuery);
|
||||
}
|
||||
cont.Response.StatusCode = 403;
|
||||
Helper.WriteError("403 - " + cont.Request.Url.PathAndQuery);
|
||||
}
|
||||
return false;
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user