8000 Merge pull request #5285 from pcpthm/winhttp-308 · libgit2/libgit2@cb6bc6f · GitHub
[go: up one dir, main page]

Skip to content

Commit cb6bc6f

Browse files
authored
Merge pull request #5285 from pcpthm/winhttp-308
Follow 308 redirect in WinHTTP transport
2 parents 541b8fc + 3f998ae commit cb6bc6f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/transports/winhttp.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
# define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2 0x00000800
5050
#endif
5151

52+
#ifndef HTTP_STATUS_PERMANENT_REDIRECT
53+
# define HTTP_STATUS_PERMANENT_REDIRECT 308
54+
#endif
55+
5256
#ifndef DWORD_MAX
5357
# define DWORD_MAX 0xffffffff
5458
#endif
@@ -1071,7 +1075,8 @@ static int winhttp_stream_read(
10711075
HTTP_STATUS_REDIRECT == status_code ||
10721076
(HTTP_STATUS_REDIRECT_METHOD == status_code &&
10731077
get_verb == s->verb) ||
1074-
HTTP_STATUS_REDIRECT_KEEP_VERB == status_code)) {
1078+
HTTP_STATUS_REDIRECT_KEEP_VERB == status_code ||
1079+
HTTP_STATUS_PERMANENT_REDIRECT == status_code)) {
10751080

10761081
/* Check for Windows 7. This workaround is only necessary on
10771082
* Windows Vista and earlier. Windows 7 is version 6.1. */

0 commit comments

Comments
 (0)
0