diff options
author | pcpthm <pcpthm@gmail.com> | 2019-10-26 17:21:29 +0900 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2020-03-26 22:12:55 +0100 |
commit | c32f5b0073a9db223aa48ae9769e2231c75fbcc5 (patch) | |
tree | 0ec9b4b56ed6b25d58a786ebfc2606f774a14d60 | |
parent | 54f0a27803c8e64592e7407ef5df0f75a9e2fc0c (diff) | |
download | libgit2-c32f5b0073a9db223aa48ae9769e2231c75fbcc5.tar.gz |
Follow 308 redirect in WinHTTP transport
-rw-r--r-- | src/transports/winhttp.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/transports/winhttp.c b/src/transports/winhttp.c index f922cb480..9910e63a8 100644 --- a/src/transports/winhttp.c +++ b/src/transports/winhttp.c @@ -48,6 +48,10 @@ # define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2 0x00000800 #endif +#ifndef HTTP_STATUS_PERMANENT_REDIRECT +# define HTTP_STATUS_PERMANENT_REDIRECT 308 +#endif + static const char *prefix_https = "https://"; static const char *upload_pack_service = "upload-pack"; static const char *upload_pack_ls_service_url = "/info/refs?service=git-upload-pack"; @@ -1014,7 +1018,8 @@ replay: HTTP_STATUS_REDIRECT == status_code || (HTTP_STATUS_REDIRECT_METHOD == status_code && get_verb == s->verb) || - HTTP_STATUS_REDIRECT_KEEP_VERB == status_code)) { + HTTP_STATUS_REDIRECT_KEEP_VERB == status_code || + HTTP_STATUS_PERMANENT_REDIRECT == status_code)) { /* Check for Windows 7. This workaround is only necessary on * Windows Vista and earlier. Windows 7 is version 6.1. */ |