Commit Graph

40 Commits

Author SHA1 Message Date
me-no-dev d37bd16c22 Initial ESP32 compatibility 2017-09-07 22:01:58 +03:00
Alexandr Zarubkin 0179c17cf9 Added simple template processor to AsyncFileResponse. (#189)
Unzipped files in SPIFFS, Streams, PROGMEM strings, callback/chunked responses may have template placeholders like %TEMPLATE_VAR% inside. If callback is specified in Async...Response constructor call, it will be used to replace these with actual strings.
The prototype of callback is String(const String&), i.e. it gets variable name and returns its value.
Template variables' delimiter is currently percent sign ('%').
Maximal placeholder length is 32 chars (chosen somewhat arbitrarily, it may be stored on stack during processing). It is not guaranteed that placeholders longer than that will be processed.

Signed-off-by: Alexandr Zarubkin <me21@yandex.ru>

# Conflicts:
#	src/WebResponses.cpp
2017-08-18 17:59:06 +03:00
Me No Dev 77a520ba24 This commit solves issues 172 and 198 (#207)
* This commit solves issues 172 and 198

* This commit solves issues 172 and 198
2017-08-18 17:52:21 +03:00
Mariusz Kryński 3d0cf89d58 Fix url decoding in POST / GET requests (#185) 2017-08-18 11:53:57 +03:00
probonopd 2e6dff35bd Allow for double quotes in boundary, closes #191 (#192)
https://tools.ietf.org/html/rfc2046#section-5.1.1
2017-08-17 20:17:21 +03:00
Zhenyu Wu fce6aad2c3 Remove Rx timeout constraint in the request response stage, fix premature connection termination (#121) 2017-03-05 20:15:25 +02:00
sticilface 3afc669f10 Flash String support (#137)
* Flash String support

* use strlen_P and strcpy_p
2017-03-05 20:06:57 +02:00
Zhenyu Wu 213387b88f Convert resursive call to iterations, reduce stack usage (#120) 2017-01-22 12:47:21 +02:00
Luc 5159d8b845 Fix #76 Problem uploading multiple files (#104) 2016-11-29 23:12:52 +02:00
Max Lunin a7c4dfb04f Template container instead of direct pointer manipulation. (#95)
* using Container instead ofdirect pointers list manipulation

* fixed different type of virtual methods.

* Fixed typo in conditional

* Renamed ListArray to LinkedList

* Const reference to String as method parameters to prevent additional copy and memory allocation when String passed by value

* fix 'min' redefinition

* removed #include <iterator>
begin/end methods it's enough for 'for( : )' loop
count() renamed to length()
spacing fixing

* Const reference to String as method parameters to prevent additional copy and memory allocation when String passed by value

* Fixed unused params warnings
2016-11-27 17:42:09 +02:00
me-no-dev d935b1d740 close the file if left open and add timeout to clients 2016-09-23 13:48:35 +03:00
me-no-dev c2de999f03 fix broken uploads 2016-09-03 23:30:14 +03:00
Me No Dev b6c9ebd9e6 make headers work with ignoreCase
Connected to: https://github.com/me-no-dev/ESPAsyncWebServer/issues/64
Eliminates: https://github.com/me-no-dev/ESPAsyncWebServer/pull/70
2016-09-02 13:52:32 +03:00
Me No Dev dab3077f2b pointless 2016-08-23 08:02:04 +03:00
Me No Dev 7110758b5a optimizations 2016-08-23 03:10:45 +03:00
Me No Dev 7f9bdec0f9 use uint8_t to store WebRequestMethod (#68)
so we can have server.on("/foo", HTTP_GET | HTTP_POST,
[](AsyncWebServerRequest *request) {}) to handle multiple methods.

this also saves a bit memory, enums are stored in int, which is 32bit on
xtensa. since we only have 7 methods (plus HTTP_ANY for everything) we
only want 7 bit, so uint8_t is pretty sufficient.
2016-08-19 22:21:08 +03:00
Me No Dev d61cc2d130 Implement sending content from progmem
make the example editor run from progmem
2016-07-21 12:25:25 +03:00
Me No Dev 933ac023cb Optimizations 2016-07-14 00:01:34 +03:00
Me No Dev 49b6046125 Add Digest Web Authentication and make it default
accept htdigest formatted hashes as well
2016-06-29 16:20:03 +03:00
Me No Dev e5a6999582 add request->redirect(url) 2016-06-26 16:20:21 +03:00
Hagai Shatz afb7dd688a New - rewrite, filters and last-modified (#47)
* New - server.rewirte() to rewrite the request url with optional get parameters injection.
New - rewrite.setFilter() and handler.setFilter() to specify a filter callback for more control on when to include them.
New - static file handler can be set with Last-Modified header value to support Not-Modified (304) response instead of serving the actual file.

* Remove clearRewrites & clearHandlers from server.mplement server distractor to delete internal members. Fixed and improved gzip stats calculation.
2016-06-25 22:04:06 +03:00
Hagai Shatz 89b19e8cde Bug fix (#45)
* HTTP 302 and 304 Support

Add support for http redirection (302) and http not modified (304) to
reduce the load the server.
server.redirect(“url”, “location”, exclude-ip) will respond with 302 to
redirect the browser to a different url, this is useful for backward
compatibility and to redirect call to CDN when not no AP mode.
server.serveStatic has a new optional parameter to get the
Last-Modified date for all files serve for this location, when the
browser request have the same If-Modified-Since header value, the
server respond with 304 code instead of serving the file.

* First round of performance improvements.

* Merge remote-tracking branch 'me-no-dev/master' into performance

# Conflicts:
#	src/WebHandlerImpl.h
#	src/WebHandlers.cpp

* use of sprintf

* Remove sections not related.

* Fix a bug to serve a file in directory (e.g. serverStatic("/", SPIFFS, "/index.html");
2016-06-18 00:32:09 +03:00
Hagai Shatz b63a86eba8 Performance (#44)
* HTTP 302 and 304 Support

Add support for http redirection (302) and http not modified (304) to
reduce the load the server.
server.redirect(“url”, “location”, exclude-ip) will respond with 302 to
redirect the browser to a different url, this is useful for backward
compatibility and to redirect call to CDN when not no AP mode.
server.serveStatic has a new optional parameter to get the
Last-Modified date for all files serve for this location, when the
browser request have the same If-Modified-Since header value, the
server respond with 304 code instead of serving the file.

* First round of performance improvements.

* Merge remote-tracking branch 'me-no-dev/master' into performance

# Conflicts:
#	src/WebHandlerImpl.h
#	src/WebHandlers.cpp

* use of sprintf

* Remove sections not related.
2016-06-17 17:42:47 +03:00
Me No Dev dc5b7f708a provide original name so proper content type is set for gzipped content 2016-06-17 02:23:18 +03:00
Me No Dev d8809137a3 fix typos 2016-06-17 01:53:21 +03:00
Me No Dev 3709dd5e14 add ability to send File objects directly
utilize request's tempFile to store a handle to the file to send
use open instead of exists in static handler
2016-06-17 01:43:59 +03:00
Me No Dev 16a6016759 fix missed rename 2016-06-16 23:27:01 +03:00
Me No Dev 798fcc3c05 rename to _tempObject and give type void * so it can be used for any object/array 2016-06-16 23:24:09 +03:00
Me No Dev 41228cb246 add uint8_t * request->_tempBuffer to be used for storing body data or other request specific stuff 2016-06-16 23:09:58 +03:00
Me No Dev 8171edd7e1 attempt fix on some edge cases
attempt to fix a case where \r can be missed and post not parsed
correctly
2016-05-20 00:55:20 +03:00
Me No Dev 937d442fce urlDecode the GET path 2016-05-13 00:41:21 +03:00
Me No Dev 7cb06b1bb1 fix typo 2016-05-13 00:19:50 +03:00
Me No Dev ffa893f770 Atempt at fixing large uploads
Fixing: https://github.com/me-no-dev/ESPAsyncWebServer/issues/29
2016-05-13 00:01:42 +03:00
Me No Dev c45b4002e5 fix leaked response if source is invalid 2016-04-11 21:42:37 +03:00
Me No Dev b1e1450bfb stability improvements for low memory 2016-04-08 17:43:16 +03:00
Me No Dev e871a222fc clean onError 2016-04-05 11:22:23 +03:00
Hopperpop 046716556e Fix buffer overflow in authenticate. 2016-03-18 22:34:18 +01:00
Me No Dev c05f719f32 fix whatever went wrong the previous time 2016-02-09 02:56:01 +02:00
Me No Dev 3bc54a8071 Revert "Merge pull request #13 from me-no-dev/improved-parsing"
This reverts commit c95ac73753, reversing
changes made to 97c938803c.
2016-02-09 02:32:14 +02:00
Me No Dev 40d5d4415e Rearrange and rename files and add index to chunked responses 2016-02-09 01:47:03 +02:00