diff --git a/examples/CC3200/Makefile.build b/examples/CC3200/Makefile.build
index 2e2c8f808ab958de1f4f09590631563e2666cf3a..257c75377b0c6a69f27d173f981434a4d488dbdb 100644
--- a/examples/CC3200/Makefile.build
+++ b/examples/CC3200/Makefile.build
@@ -23,14 +23,7 @@ IPATH = . ../.. $(REPO_PATH)
 
 VPATH = ../..
 
-MONGOOSE_FEATURES = \
-  -DMG_DISABLE_DIRECTORY_LISTING \
-  -DMG_DISABLE_DAV \
-  -DMG_ENABLE_HTTP_STREAMING_MULTIPART \
-  -DMG_MAX_HTTP_HEADERS=20 \
-  -DMG_MAX_HTTP_REQUEST_SIZE=1024 \
-  -DMG_MAX_PATH=40 \
-  -DMG_MAX_HTTP_SEND_MBUF=1024
+MONGOOSE_FEATURES = -DMG_ENABLE_HTTP_STREAMING_MULTIPART
 
 SDK_FLAGS = -DUSE_FREERTOS -DSL_PLATFORM_MULTI_THREADED
 # -DTARGET_IS_CC3200 would reduce code size by using functions in ROM
diff --git a/examples/ESP8266_RTOS/user/Makefile b/examples/ESP8266_RTOS/user/Makefile
index 20c4e882e7467d1719a0609eb50b56a376e3ccb9..85700bed3e80cb168590febab519b7cb8dc6e46c 100644
--- a/examples/ESP8266_RTOS/user/Makefile
+++ b/examples/ESP8266_RTOS/user/Makefile
@@ -26,8 +26,6 @@ endif
 DEFINES += -DCS_PLATFORM=3 \
            -DMG_NO_BSD_SOCKETS \
            -DMG_DISABLE_FILESYSTEM \
-           -DMG_MAX_HTTP_HEADERS=20 -DMG_MAX_HTTP_REQUEST_SIZE=1024 \
-           -DMG_MAX_PATH=40 -DMG_MAX_HTTP_SEND_MBUF=1024 \
            -DRTOS_SDK -DMG_LWIP -DLWIP_TIMEVAL_PRIVATE=0 \
            -DMG_INTERNAL=
 
diff --git a/mongoose.h b/mongoose.h
index 8022adae41007da6d29a5b0ea6adac0c3c3d1902..f357a25fe02b4e06298b35622415a8f00124b8cd 100644
--- a/mongoose.h
+++ b/mongoose.h
@@ -239,6 +239,18 @@ struct dirent *readdir(DIR *dir);
 #endif
 #endif
 
+#ifndef MG_MAX_HTTP_REQUEST_SIZE
+#define MG_MAX_HTTP_REQUEST_SIZE 8192
+#endif
+
+#ifndef MG_MAX_HTTP_SEND_MBUF
+#define MG_MAX_HTTP_SEND_MBUF 4096
+#endif
+
+#ifndef MG_MAX_HTTP_HEADERS
+#define MG_MAX_HTTP_HEADERS 40
+#endif
+
 #endif /* CS_PLATFORM == CS_P_WINDOWS */
 #endif /* CS_COMMON_PLATFORMS_PLATFORM_WINDOWS_H_ */
 #ifndef CS_COMMON_PLATFORMS_PLATFORM_UNIX_H_
@@ -322,6 +334,18 @@ typedef struct stat cs_stat_t;
 
 #define closesocket(x) close(x)
 
+#ifndef MG_MAX_HTTP_REQUEST_SIZE
+#define MG_MAX_HTTP_REQUEST_SIZE 8192
+#endif
+
+#ifndef MG_MAX_HTTP_SEND_MBUF
+#define MG_MAX_HTTP_SEND_MBUF 4096
+#endif
+
+#ifndef MG_MAX_HTTP_HEADERS
+#define MG_MAX_HTTP_HEADERS 40
+#endif
+
 #endif /* CS_PLATFORM == CS_P_UNIX */
 #endif /* CS_COMMON_PLATFORMS_PLATFORM_UNIX_H_ */
 #ifndef CS_COMMON_PLATFORMS_PLATFORM_ESP_LWIP_H_
@@ -401,6 +425,11 @@ unsigned long os_random(void);
 #define MG_DISABLE_SYNC_RESOLVER 1
 #define MG_DISABLE_POPEN 1
 #define MG_DISABLE_CGI 1
+/* Only SPIFFS supports directories, SLFS does not. */
+#ifndef CC3200_FS_SPIFFS
+#define MG_DISABLE_DAV 1
+#define MG_DISABLE_DIRECTORY_LISTING 1
+#endif
 
 #include <simplelink/include/simplelink.h>
 
@@ -1922,23 +1951,23 @@ extern "C" {
 #endif /* __cplusplus */
 
 #ifndef MG_MAX_HTTP_HEADERS
-#define MG_MAX_HTTP_HEADERS 40
+#define MG_MAX_HTTP_HEADERS 20
 #endif
 
 #ifndef MG_MAX_HTTP_REQUEST_SIZE
-#define MG_MAX_HTTP_REQUEST_SIZE 8192
+#define MG_MAX_HTTP_REQUEST_SIZE 1024
 #endif
 
 #ifndef MG_MAX_PATH
 #ifdef PATH_MAX
 #define MG_MAX_PATH PATH_MAX
 #else
-#define MG_MAX_PATH 1024
+#define MG_MAX_PATH 256
 #endif
 #endif
 
 #ifndef MG_MAX_HTTP_SEND_MBUF
-#define MG_MAX_HTTP_SEND_MBUF 4096
+#define MG_MAX_HTTP_SEND_MBUF 1024
 #endif
 
 #ifndef MG_WEBSOCKET_PING_INTERVAL_SECONDS