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

feat: Implemented support for filters and removable routes in WebServer #2225

Merged

Conversation

ayushsharma82
Copy link
Contributor

This PR implements filters and removable routes in RP2040 arduino core, making it API compatible with recent changes to ESP32 & ESP8266 WebServer API.

Note

Please merge when all ESP32 repo pull requests mentioned below are merged.

Reference (Recent additions to ESP32 WebServer API):

Reference (Recent addition to ESP8266 WebServer API):

Noteable Changes:

  1. Request Filters (setFilter)
  2. Removable Routes (removeRoute, removeHandler, _removeRequestHandler)

@earlephilhower
Copy link
Owner

You need to run tools/restyle.sh to get the formatting correct for the repo here, and (void) out an unused parameter to get through CI. OTW, seems nice and thanks for including an example!

@ayushsharma82
Copy link
Contributor Author

Apparently, a lot of files weren't conforming to suggested format. I ran tests/restyle.sh.

@ayushsharma82
Copy link
Contributor Author

CI style check failed. Can this be due to different astyle package version on my local machine? I have this on my PC: Artistic Style Version 3.5.

@ayushsharma82
Copy link
Contributor Author

Fixed example & formatting.

PS: I formatted WebServer folder only instead of whole library.

@earlephilhower
Copy link
Owner

Weird about the astyle version differences, thx for fixing it. CI is using whatever the GH runner has installed which seems to match my own version for output (but not revision number).

For the callback build error, I haven't dug into it yet but in this core I split out the HTTPServer from the Webserver. This lets us support HTTPS and HTTP servers with no extra code. Separation of duties, the template (WebServer/WebServerSecure) handles incoming connections and passes it on to the HTTP parsing engine.

@ayushsharma82
Copy link
Contributor Author

Fixed everything and tested locally. This should pass all CI tests.

Also, ESP32 PRs are merged therefore this PR is ready for merger too.

@earlephilhower earlephilhower merged commit 1775fed into earlephilhower:master Jun 13, 2024
13 checks passed
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.

None yet

2 participants