Skip to content

Commit f302221

Browse files
authored
Fixes issue with no Authentication attribute in controllers (#42)
1 parent f780f70 commit f302221

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nanoFramework.WebServer/WebServer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ private void StartListener()
555555

556556
// Check auth first
557557
mustAuthenticate = route.Authentication != null && route.Authentication.AuthenticationType != AuthenticationType.None;
558-
isAuthOk = false;
558+
isAuthOk = !mustAuthenticate;
559559

560560
if (mustAuthenticate)
561561
{
@@ -578,7 +578,7 @@ private void StartListener()
578578
}
579579
}
580580

581-
if (mustAuthenticate && isAuthOk)
581+
if (isAuthOk)
582582
{
583583
route.Callback.Invoke(null, new object[] { new WebServerEventArgs(context) });
584584
}

0 commit comments

Comments
 (0)