1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

26 Commits

Author SHA1 Message Date
Earle F. Philhower, III
dbd7b8218d
Fix serach order for index.htm(l)(.gz) files (#7069)
Fixes #6984

When a directory index is requested with an explicit index.html, follow
the original webserver order and check for: index.htm, index.htm.gz,
index.html, index.html.gz, in order.

Fixes the regressions introduced in 9f2cfb8 and 6768116
2020-02-09 15:58:06 -03:00
JasperHorn
8242d72271 Add LittleFS support to ESP8266WebServer.serveStatic() (#6987)
* Remove trailing whitespace

* Improve "is file" check for LittleFS support

The previous implementation was based on a quirk of SPIFFS (that exists
returns false for directories) so it wouldn't work with LittleFS. This
implementation works with both.

Co-authored-by: Develo <deveyes@gmail.com>
2020-01-04 20:33:05 -08:00
Matthias Hertel
a738884387 Handle HEAD requests for static files correctly (#6837)
* Handle HEAD requests for static files correctly

* Handle HEAD requests for static files correctly
2019-12-04 18:23:25 +01:00
Earle F. Philhower, III
6768116b8c Only add "l" to XX.htm URLs if XX.html exists (#6794)
Fixes #6792

Only append the "l" to ".htm" when there actually is a ".html" file
present.  If not, fall-thru like before and try .gz through the normal
paths.
2019-11-19 02:43:47 -03:00
George Talusan
9f2cfb8218 fallback onto index.html if index.htm fails (#2614) 2019-10-29 20:25:03 -03:00
Earle F. Philhower, III
7036297920 Convert ESP8266WebServer* into templatized model (#5982)
* Convert ESP8266WebServer* into templatized model

Supercedes #4912

Refactor the three versions of ESP8266WebServer and *WebServerSecure to a
single templated class. Use "using" to enable old, non-templated names to b
used (so no user changes required to compile or run).

Fixes #4908 and clean up the code base a lot.

Basic tests run (the ones in the example code).

No code changes are required in userland except for setting the SSL
certificates which now use a cleaner "getServer()" accessor and lets the
app use the native BearSSL calls on the WiFiClientSecure object.

@devyte should be proud, it removes virtuals and even has template specialization...

* Fix HTTPUpdate templates and examples

* Fix HTTPUpdateServer library build

Need to remove dot-a linkage since there are no .cpp files in the
directory anymore due to templates.

* Provide backward-compat names for updt template

Allow existing code to use the same well known names for
HTTPUpdateSecure.

* Remove ClientType from all templates, auto-infer

Remove the ClientType template parameter from all objects.  Simplifies
the code and makes it more foolproof.

Add a "using" in each server to define the type of connection returned
by all servers, which is then used in the above templates automatically.

* Can safely include FS.h now that SD/SPIFFS unified

* Move the templates/objects to their own namespaces

* Fix merge issues with untemplated methods

* Address review comments

* Fix mock test, remove warnings inside test dir

Make the simple mock test CI job pass and clean up
any spurious warnings in the test directory.

There still are warnings in the libraries and core, but they
should be addressed in a separate PR.
2019-07-04 10:58:22 +02:00
Allman-astyler
eea9999dc5 Revert "Allman now (#6080)" (#6090)
This reverts commit 98125f88605cd7e46e9be4e1b3ad0600dd5d2b51.
2019-05-14 00:09:54 +02:00
Allman-astyler
98125f8860 Allman now (#6080)
* switch restyle script for CI

* remove confirmation

* restyle with allman
2019-05-13 16:41:34 +02:00
Develo
5328a8b91e
additional mimetable fixes, additional string moves to progmem (#4371) 2018-02-16 16:56:33 -03:00
Earle F. Philhower, III
291bc6bca5
Wrap mimetype strings in FSPTR()s (#4338)
Mimetype is now in progmem, so any accesses to it need to be using FPSTR()
wrapped Strings.

Fixes #4329
2018-02-10 08:12:38 -08:00
Develo
bcbd5961c0
add begin(port) to esp8266webserver, move some strings to flash, some refactoring (#4148)
* add begin(port) to esp8266webserver, move some strings to flash, some refactoring

* Moved more strings to flash, unified some strings

* move mimetable strings into a standalone file

* more string moves to flash, remove duplicates, refactor of template method, minor styling

* Reverted moving small string to flash (no heap advantage, reduces bin size)
2018-02-07 00:30:07 -03:00
Earle F. Philhower, III
85be0f300a Move MIME type table into PROGMEM to save RAM (#3475)
The extension -> MIME type routine uses lots of constant strings which end
up in the RODATA segment of RAM.  Refactor the comparison to use a table of
strings stored in PMMEM instead, freeing ~370 bytes for the heap.
2017-08-07 15:44:30 +03:00
wuweixin
0fa34430e6 ESP8266WebServer: add application/json content type 2017-05-15 18:38:24 +08:00
Rodion Kvashnin
2126146e20 Fix warnings (#2881)
* Suppressed -Wunused-parameter and -Wunused-function by casting to void unused identifiers.

* Explicit initialization of all fields to suppress -Wmissing-field-initializers.

* Fixed signed/unsigned integer comparison.

* memset initialization of structs.

* More -Wunused-parameter fixes.
2017-01-31 10:07:59 +03:00
Clemens Kirchgatterer
4dc4e75216 allow F() to be used for uri parameter (#2319) 2016-07-26 18:23:14 +08:00
Marvin Roger
e23e4d90da Add font MIME types, fix #1601
As per http://stackoverflow.com/a/10864297
2016-03-05 14:38:02 +01:00
Assaf Inbal
728e2dfae9 Added 'text/cache-manifest' content type 2016-02-08 06:58:19 +02:00
Ivan Grokhotkov
9e930e5d34 Fix link-time dependency of ESP8266WebServer on SPIFFS (#862) 2015-11-30 12:20:15 +03:00
Ivan Grokhotkov
a6e01b8d27 Fix handling of / to load index.htm (#1085)
Thanks @sticilface
2015-11-30 08:43:08 +03:00
Me No Dev
a44632b8cf make compiler happier 2015-11-25 18:11:16 +02:00
Me No Dev
bc48022118 spend more time understanding the logic 2015-11-21 21:29:54 +02:00
Me No Dev
94a7f63cda fix static handler 2015-11-21 21:04:07 +02:00
Me No Dev
50eb6d9ff2 Make RequestHandler handle uploads 2015-11-19 22:52:52 +02:00
Andrew Melvin
5c6f98643b Changes to static request handler 2015-11-12 07:27:21 +00:00
Kaloyan Kovachev
20de6b8a6a Add SVG as file type and default to binary stream for static handler 2015-11-01 17:59:24 +02:00
Ivan Grokhotkov
4c8a29a74d Expose request handlers in ESP8266WebServer
as discussed in #837
2015-10-06 15:26:42 +03:00