[PATCH] winhttp: No need to search for proxy for localhost urls

Hans Leidekker hans at codeweavers.com
Thu May 20 03:14:47 CDT 2021


On Thu, 2021-05-20 at 09:01 +0300, Jon Doron wrote:
> This will resolve the bug:
> https://bugs.winehq.org/show_bug.cgi?id=43011
> 
> Signed-off-by: Jon Doron <arilou at gmail.com>
> ---
>  dlls/winhttp/session.c | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c
> index f052c3c569c..4a1a6803acb 100644
> --- a/dlls/winhttp/session.c
> +++ b/dlls/winhttp/session.c
> @@ -1872,6 +1872,21 @@ static BOOL run_script( char *script, DWORD size, const WCHAR *url, WINHTTP_PROX
>      return ret;
>  }
>  
> 
> +static BOOL is_localhost( LPCWSTR url )
> +{
> +    LPCWSTR scheme;
> +
> +    scheme = wcsstr(url, L"://");
> +    if (!scheme)
> +    {
> +        return FALSE;
> +    }
> +
> +    return !wcsnicmp( scheme, L"://127.0.0.1", _countof(L"://127.0.0.1") - 1 ) ||
> +           !wcsnicmp( scheme, L"://localhost", _countof(L"://localhost") - 1) ||
> +           !wcsnicmp( scheme, L"://::1", _countof(L"://::1") - 1 );
> +}
> +

This would need a test, but I doubt that native does anything like
that. Note that any hostname can resolve to 127.0.0.1. 





More information about the wine-devel mailing list