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

Added overload on send to cleanly handle char arrays in WebServer #6721

Merged
merged 1 commit into from
May 11, 2022

Conversation

lbernstone
Copy link
Contributor

By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes

Checklist

  1. [X ] Please provide specific title of the PR describing the change, including the component name (eg. „Update of Documentation link on Readme.md“)
  2. [ X] Please provide related links (eg. Issue which will be closed by this Pull Request)
  3. [X ] Please update relevant Documentation if applicable
  4. [X ] Please check Contributing guide

This entire section above can be deleted if all items are checked.


Description of Change

Multiple issues have been opened about users having strings "disappear" on send. This seem to be caused by feeding WebServer::send() a char array. This gets cast into a const String, and if the size exceeds the maximum possible allocation, there is a silent fail and an empty String gets sent out. While not truly a fix, this will raise an error message if the String allocation fails.

Tests scenarios

Tested on esp32-c3 dev board, current master, but seems very generalized.

Related links

Fixes #6704

@VojtechBartoska VojtechBartoska added this to the 2.0.4 milestone May 10, 2022
@me-no-dev me-no-dev merged commit b42b208 into espressif:master May 11, 2022
@me-no-dev
Copy link
Member

Thanks @lbernstone :)

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

Successfully merging this pull request may close these issues.

ESP32-S2 Webserver Library
3 participants