httpd: ssi: support selecting ssi files by file flags, not by extension (at runtime) only

This commit is contained in:
goldsimon 2017-11-16 22:29:44 +01:00
parent 8bd670430a
commit da01bc4d15
2 changed files with 12 additions and 2 deletions

View File

@ -2234,8 +2234,16 @@ http_find_file(struct http_state *hs, const char *uri, int is_09)
} else {
file = http_get_404_file(hs, &uri);
}
#if LWIP_HTTPD_SSI && LWIP_HTTPD_SSI_BY_FILE_EXTENSION
tag_check = http_uri_is_ssi(file, uri);
#if LWIP_HTTPD_SSI
if (file != NULL) {
if (file->flags & FS_FILE_FLAGS_SSI) {
tag_check = 1;
} else {
#if LWIP_HTTPD_SSI_BY_FILE_EXTENSION
tag_check = http_uri_is_ssi(file, uri);
#endif /* LWIP_HTTPD_SSI_BY_FILE_EXTENSION */
}
}
#endif /* LWIP_HTTPD_SSI */
}
if (file == NULL) {

View File

@ -52,6 +52,8 @@ struct fsdata_chksum {
#define FS_FILE_FLAGS_HEADER_INCLUDED 0x01
#define FS_FILE_FLAGS_HEADER_PERSISTENT 0x02
#define FS_FILE_FLAGS_HEADER_KEEPALIVE 0x04
#define FS_FILE_FLAGS_SSI 0x08
/** Define FS_FILE_EXTENSION_T_DEFINED if you have typedef'ed to your private
* pointer type (defaults to 'void' so the default usage is 'void*')