Commit Graph

48 Commits

Author SHA1 Message Date
Develo f3ebe2dea9 Remove warnings for unused params (#620) 2019-10-14 11:30:06 +03:00
sascha lammers 403752a942 Added method to access clients of AsyncWebSocket (#583)
* Added method to access clients of AsyncWebSocket

* https://github.com/me-no-dev/ESPAsyncWebServer/issues/571

* Conflict with crypto library
2019-10-02 14:16:43 +03:00
Merlin Schumacher fc71230a31 Change JSON MIME type to application/json (#311) 2018-07-24 20:13:14 +02:00
me-no-dev 1078e9166b Add option to skip a callback if source data is not yet available 2018-07-15 10:21:21 +02:00
Alexandr Zarubkin 8139925eb9 Fixed templating engine bug. (#267)
Signed-off-by: Alexandr Zarubkin <me21@yandex.ru>
2017-11-06 15:47:45 +02:00
Greg Lincoln 46eebddd76 Allow "default" headers to be defined for all responses. (#230)
* Add DefaultHeaders singleton.

* Add documentation for DefaultHeaders.
2017-09-18 13:15:49 +08:00
Alexandr Zarubkin 30f9dab08d Fixed chunked file response length. (#219)
Signed-off-by: Alexandr Zarubkin <me21@yandex.ru>
2017-09-05 20:13:16 +03:00
Alexandr Zarubkin e6c432e563 Something got lost during pull request #189. Fixes #211, updates documentation. (#213)
* Removed unnecessary memmove from chunked response generation.

* Added simple template processor to AsyncFileResponse.

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>
2017-08-31 19:44:23 +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
Alexandr Zarubkin 4dcd458d13 Removed unnecessary memmove from chunked response generation. (#188) 2017-08-18 11:54:52 +03:00
Me No Dev bab5457584 Fix case where space is not enough for a chunk 2017-01-25 21:25:21 +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 1163808495 add some mime types and a commented implementation of etag for cache 2016-08-25 22:15:17 +03:00
Me No Dev a14e93dd84 Initial SSL Implementation 2016-08-24 22:32:27 +03:00
Me No Dev 7110758b5a optimizations 2016-08-23 03:10:45 +03:00
Me No Dev cc38b8d57c fix some methods and add setCode to all responses 2016-07-22 00:03:12 +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
Hagai Shatz 11b7bd1d3a Fix bug in AsyncStaticWebHandler (#37)
* 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.

* Fix path problems in static handler and improve performance.

* Revert "Merge remote-tracking branch 'me-no-dev/master'"

This reverts commit 1621206357843b5de0272fe4579387af3011e656, reversing
changes made to a01972c9e569967dd3d761c364066518b4901e46.

* Revert "HTTP 302 and 304 Support"

This reverts commit a01972c9e569967dd3d761c364066518b4901e46.

* Sync with me-no-dev/master

* Fix AsyncStaticWebHandler

Fix ambiguity of serving file or directory.
The following options will all have the same outcome, the last two will
server the default file ‘index.htm’ faster:
server.serveStatic("/fs", SPIFFS, "/web");
server.serveStatic("/fs/", SPIFFS, "/web");
server.serveStatic("/fs", SPIFFS, "/web/");
server.serveStatic("/fs/", SPIFFS, "/web/");
2016-06-18 19:43:52 +03:00
Me No Dev e46d4d7418 fix broken send of gzipped files 2016-06-18 01:28:36 +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 5bbc732028 remove Access-Control-Allow-Origin 2016-06-17 17:41:06 +03:00
Clemens Kirchgatterer 78fc89d462 filename quote changed from ' to " (#43)
now for real. :-)
2016-06-17 17:34:38 +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 5ee66e1842 send just the filename in Content-Disposition
Thanks go to: @hagai-shatz
2016-06-16 22:13:02 +03:00
Clemens Kirchgatterer f384cd1f76 fix for file download/rendering response (#40)
tested with chromium and firefox and all content types i had handy.

chrome and firefox render all files inline, if they can. chrome downloads files when asked to download, firefox opens a download dialog.
2016-06-15 18:21:16 +03:00
Me No Dev 8d67809acf Add AsyncWebSocket plugin 2016-04-23 15:11:32 +03:00
Me No Dev b1e1450bfb stability improvements for low memory 2016-04-08 17:43:16 +03:00
Me No Dev ced8ac1c4c Send as much as possible from the response with the headers
related to: https://github.com/me-no-dev/ESPAsyncWebServer/issues/15
2016-04-08 14:55:41 +03:00
andig 9a291c876c Gracefully handle out of memory 2016-04-07 12:39:07 +02: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
Me No Dev f8deeee5bc Make response stream to not require content length
Update the example in ReadMe as well
2016-02-01 03:03:59 +02:00
Me No Dev 729b9c223e Make ResponseStream resize when needed and actually work 2016-02-01 01:42:45 +02:00
Me No Dev b84fc1c976 fix chunked output 2016-02-01 01:08:33 +02:00
Me No Dev 9e79985575 ReadMe update 2016-01-31 17:15:23 +02:00
Me No Dev 9296156ab5 Add HTTP/1.1 chunked response and allow stream and callback responses to not have content length
ContentLength and ContentType have setters (before you send the
response)
2016-01-27 18:46:49 +02:00
Me No Dev 36b64df702 change to support new cbuf api 2016-01-27 16:17:34 +02:00
Me No Dev 8fed4c42f3 return if called from interrupt 2016-01-26 17:52:49 +02:00
Me No Dev 16012daae6 make response stream e sendable later and the buffer size to be specifiable 2016-01-22 13:36:38 +02:00
Me No Dev 1e7b9446df stop printing unnecessary debug info 2016-01-21 10:40:01 +02:00
Me No Dev 41846249ec some more work on outputting as stream from the loop 2016-01-21 10:29:38 +02:00
Me No Dev 36853c9122 attempt at outgoing stream 2016-01-19 21:47:26 +02:00
Me No Dev f505be9a08 fixes 2015-12-22 01:41:57 +02:00
Me No Dev 457db5e7f5 better up responses 2015-12-19 20:48:53 +02:00
Me No Dev b1f276a1a7 Initial Import 2015-12-19 18:53:33 +02:00