@@ -126,11 +126,11 @@ struct git_http_client {
126126
127127bool git_http_response_is_redirect (git_http_response * response )
128128{
129- return (response -> status == 301 ||
130- response -> status == 302 ||
131- response -> status == 303 ||
132- response -> status == 307 ||
133- response -> status == 308 );
129+ return (response -> status == GIT_HTTP_MOVED_PERMANENTLY ||
130+ response -> status == GIT_HTTP_FOUND ||
131+ response -> status == GIT_HTTP_SEE_OTHER ||
132+ response -> status == GIT_HTTP_TEMPORARY_REDIRECT ||
133+ response -> status == GIT_HTTP_PERMANENT_REDIRECT );
134134}
135135
136136void git_http_response_dispose (git_http_response * response )
@@ -316,13 +316,13 @@ static int resend_needed(git_http_client *client, git_http_response *response)
316316{
317317 git_http_auth_context * auth_context ;
318318
319- if (response -> status == 401 &&
319+ if (response -> status == GIT_HTTP_STATUS_UNAUTHORIZED &&
320320 (auth_context = client -> server .auth_context ) &&
321321 auth_context -> is_complete &&
322322 !auth_context -> is_complete (auth_context ))
323323 return 1 ;
324324
325- if (response -> status == 407 &&
325+ if (response -> status == GIT_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED &&
326326 (auth_context = client -> proxy .auth_context ) &&
327327 auth_context -> is_complete &&
328328 !auth_context -> is_complete (auth_context ))
@@ -914,12 +914,12 @@ static int proxy_connect(
914914
915915 assert (client -> state == DONE );
916916
917- if (response .status == 407 ) {
917+ if (response .status == GIT_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED ) {
918918 save_early_response (client , & response );
919919
920920 error = GIT_RETRY ;
921921 goto done ;
922- } else if (response .status != 200 ) {
922+ } else if (response .status != GIT_HTTP_STATUS_OK ) {
923923 git_error_set (GIT_ERROR_NET , "proxy returned unexpected status: %d" , response .status );
924924 error = -1 ;
925925 goto done ;
@@ -1236,7 +1236,7 @@ int git_http_client_send_request(
12361236
12371237 error = 0 ;
12381238
1239- if (response .status != 100 ) {
1239+ if (response .status != GIT_HTTP_STATUS_CONTINUE ) {
12401240 save_early_response (client , & response );
12411241 goto done ;
12421242 }
0 commit comments