File tree Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change @@ -215,23 +215,20 @@ static void ICACHE_FLASH_ATTR http_connect_callback( void * arg )
215
215
ua_len = strlen (ua_header );
216
216
}
217
217
218
- char * host_header = "" ;
218
+ char host_header [ 32 ] = "" ;
219
219
int host_len = 0 ;
220
220
if ( os_strstr ( req -> headers , "Host:" ) == NULL && os_strstr ( req -> headers , "host:" ) == NULL )
221
221
{
222
- int max_header_len = 9 + strlen (req -> hostname ); // 9 is fixed size of "Host:[space][cr][lf]\0"
223
222
if ((req -> port == 80 )
224
223
#ifdef CLIENT_SSL_ENABLE
225
224
|| ((req -> port == 443 ) && ( req -> secure ))
226
225
#endif
227
226
)
228
227
{
229
- host_header = alloca (max_header_len );
230
228
os_sprintf ( host_header , "Host: %s\r\n" , req -> hostname );
231
229
}
232
230
else
233
231
{
234
- host_header = alloca (max_header_len + 6 ); // 6 is worst case of ":port" where port is maximum 5 digits
235
232
os_sprintf ( host_header , "Host: %s:%d\r\n" , req -> hostname , req -> port );
236
233
}
237
234
host_len = strlen (host_header );
You can’t perform that action at this time.
0 commit comments