Adapted mongoose header parsing fix