Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error when one URL is called twice consecutively #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jostmorgenstern
Copy link

@jostmorgenstern jostmorgenstern commented Oct 31, 2021

In the exampe DynamicPage.ino, in the method handleAcs, currentUri is set to the parameter uri to check if the method is called the first or second time during a request. However, when one URL is requested twice consecutively, currentUri is still set to that URL from the previous request. This PR fixes it by resetting currentUri to an empty string after every successfull URL handling.

@Hieromon
Copy link
Owner

Hieromon commented Nov 2, 2021

Is it an unreachable logical path?

Copy link

@JesseRiemens JesseRiemens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this is helpful. Please explain?

@@ -78,6 +78,7 @@ bool handleAcs(HTTPMethod method, String uri) {
else {
return false; // Not found to accessing exception URI.
}
currentUri = String("");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This statement will never be reached since it is below an if else with a return in it. Besides, it defies the check. Why would this statement be beneficial?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants