zan-extension/swoole_http_server.c
//header filed format,like:Content-Type

header filed format,like:Content-Type
header filed format like : Content - Type
static inline void http_header_key_format(char *key, int length)
{
    int i, state = 0;
    for (i = 0; i < length; i++)
    {
        if (state == 0)
        {
            if (key[i] >= 'a' && key[i] <= 'z')
            {
                key[i] -= 'a' - 'A';
            }
            state = 1;
        }
        else if (key[i] == '-')
        {
            state = 0;
        }
        else
        {
            if (key[i] >= 'A' && key[i] <= 'Z')
            {
                key[i] += 'a' - 'A';
            }
        }
    }
}
static inline void http_header_key_format ( char * key , int length ) { int i , state = 0 ; for ( i = 0 ; i < length ; i ++ ) { if ( state == 0 ) { if ( key [ i ] >= ' ' && key [ i ] <= ' ' ) { key [ i ] -= ' ' - ' ' ; } state = 1 ; } else if ( key [ i ] == ' ' ) { state = 0 ; } else { if ( key [ i ] >= ' ' && key [ i ] <= ' ' ) { key [ i ] += ' ' - ' ' ; } } } }
header filed format,like:Content-Type
header filed format like : Content - Type