mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 21:44:38 +08:00
httpd: SSI types should be overridable (task #15071)
Add define LWIP_HTTPD_SSI_EXTENSIONS to make the extension list overridable, clarify documentation of LWIP_HTTPD_SSI_BY_FILE_EXTENSION a bit. Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
parent
f6b728b24c
commit
ff8d1a384f
@ -113,11 +113,11 @@ static const tHTTPHeader g_psHTTPHeaders[] = {
|
|||||||
|
|
||||||
#endif /* LWIP_HTTPD_DYNAMIC_HEADERS */
|
#endif /* LWIP_HTTPD_DYNAMIC_HEADERS */
|
||||||
|
|
||||||
#if LWIP_HTTPD_SSI
|
#if LWIP_HTTPD_SSI && LWIP_HTTPD_SSI_BY_FILE_EXTENSION
|
||||||
static const char *const g_pcSSIExtensions[] = {
|
static const char *const g_pcSSIExtensions[] = {
|
||||||
".shtml", ".shtm", ".ssi", ".xml", ".json"
|
LWIP_HTTPD_SSI_EXTENSIONS
|
||||||
};
|
};
|
||||||
#define NUM_SHTML_EXTENSIONS LWIP_ARRAYSIZE(g_pcSSIExtensions)
|
#define NUM_SHTML_EXTENSIONS LWIP_ARRAYSIZE(g_pcSSIExtensions)
|
||||||
#endif /* LWIP_HTTPD_SSI */
|
#endif /* LWIP_HTTPD_SSI && LWIP_HTTPD_SSI_BY_FILE_EXTENSION */
|
||||||
|
|
||||||
#endif /* LWIP_HTTPD_STRUCTS_H */
|
#endif /* LWIP_HTTPD_STRUCTS_H */
|
||||||
|
@ -112,7 +112,9 @@
|
|||||||
/** Set this to 0 to prevent parsing the file extension at runtime to decide
|
/** Set this to 0 to prevent parsing the file extension at runtime to decide
|
||||||
* if a file should be scanned for SSI tags or not.
|
* if a file should be scanned for SSI tags or not.
|
||||||
* Default is 1 (file extensions are checked using the g_pcSSIExtensions array)
|
* Default is 1 (file extensions are checked using the g_pcSSIExtensions array)
|
||||||
* Set to 2 to override this runtime test function.
|
* Set to 2 to override this runtime test function. In this case, you have to
|
||||||
|
* provide an external function that does the check:
|
||||||
|
* u8_t http_uri_is_ssi(struct fs_file *file, const char *uri)
|
||||||
*
|
*
|
||||||
* This is enabled by default, but if you only use a newer version of makefsdata
|
* This is enabled by default, but if you only use a newer version of makefsdata
|
||||||
* supporting the "-ssi" option, this info is already present in
|
* supporting the "-ssi" option, this info is already present in
|
||||||
@ -121,6 +123,14 @@
|
|||||||
#define LWIP_HTTPD_SSI_BY_FILE_EXTENSION 1
|
#define LWIP_HTTPD_SSI_BY_FILE_EXTENSION 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/** This is a list of file extensions handled as SSI files. This define
|
||||||
|
* is used to initialize a 'const char *const[]'. It is only used if
|
||||||
|
* LWIP_HTTPD_SSI_BY_FILE_EXTENSION != 0.
|
||||||
|
*/
|
||||||
|
#if !defined LWIP_HTTPD_SSI_EXTENSIONS || defined __DOXYGEN__
|
||||||
|
#define LWIP_HTTPD_SSI_EXTENSIONS ".shtml", ".shtm", ".ssi", ".xml", ".json"
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Set this to 1 to support HTTP POST */
|
/** Set this to 1 to support HTTP POST */
|
||||||
#if !defined LWIP_HTTPD_SUPPORT_POST || defined __DOXYGEN__
|
#if !defined LWIP_HTTPD_SUPPORT_POST || defined __DOXYGEN__
|
||||||
#define LWIP_HTTPD_SUPPORT_POST 0
|
#define LWIP_HTTPD_SUPPORT_POST 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user