Commit Graph
19 Commits
Author SHA1 Message Date
Me No Dev e3e7a5e91e add option to set last modified from struct tm 2016-06-27 20:08:09 +03:00
Me No Dev f8141fcd0e fix warning about setting String to NULL 2016-06-26 16:21:44 +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 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 1621206357, reversing
changes made to a01972c9e5.

* Revert "HTTP 302 and 304 Support"

This reverts commit a01972c9e5.

* 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
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
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
Hagai Shatz a52873b451 Fix path problems in static handler and improve performance. (#41) 2016-06-16 12:52:11 +03: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
Andrew Melvin 09ed9271a2 Check if file exists before returning canHandle true for serveStatic 2016-01-28 00:06:08 +02:00
Andrew Melvin c6b2fa0ad4 fix serving url with no trailing / 2016-01-27 23:42:16 +02:00
Andrew Melvin 9c5d0edf76 Add DEBUGF 2016-01-27 22:16:21 +02:00
Andrew Melvin d67ca5cbda fix serveStatic to map paths correctly 2016-01-27 21:59:27 +02:00
Me No Dev c4529f0f99 expose urlDecode to the masses 2016-01-22 12:58:44 +02:00
Me No Dev c9d1337fcb missing set for the target path if it's a file. thanks @andig 2016-01-21 19:52:06 +02:00
Me No Dev b1f276a1a7 Initial Import 2015-12-19 18:53:33 +02:00