chmorgan / esphttpd-freertos

freertos example of libesphttpd for esp32 and esp8266
53 stars 14 forks source link

Incorrect path in ROUTE_REDIRECT? #4

Closed jcwren closed 5 years ago

jcwren commented 6 years ago

In the ROUTE_REDIRECTs below, was it intended that the second one should instead be ROUTE_REDIRECT("/test/", "/test/index.html"),?

Lines 173..175 in user_main.c

    ROUTE_REDIRECT("/test", "/test/index.html"),
    ROUTE_REDIRECT("/test", "/test/index.html"),
    ROUTE_CGI("/test/test.cgi", cgiTestbed),
chmorgan commented 5 years ago

@jcwren it could be. Does it behave differently with that change? I thought the trailing slash wouldn't matter.

jcwren commented 5 years ago

I'll have to check, but as I recall, if you ended the URL with a '/', it would not redirect correctly. I'd have to test to see, it's been almost 2 months.

chmorgan commented 5 years ago

Given that the lines are duplicate you are probably correct. Or you could remove the duplicate line. Either way seems like a reasonable change.

phatpaul commented 5 years ago

fixed in PR #10