Skip to content

Commit cdcb674

Browse files
committed
Fix default scheme, add test for http GHES
1 parent f5a4da1 commit cdcb674

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/http/oauth/oauth_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ func TestAPIHostResolver_AuthorizationServerURL(t *testing.T) {
633633
}{
634634
{
635635
name: "valid host returns authorization server URL",
636-
host: "http://github.com",
636+
host: "https://github.com",
637637
expectedURL: "https://github.com/login/oauth",
638638
expectedStatusCode: http.StatusOK,
639639
},
@@ -663,6 +663,12 @@ func TestAPIHostResolver_AuthorizationServerURL(t *testing.T) {
663663
expectedURL: "https://ghe.example.com/login/oauth",
664664
expectedStatusCode: http.StatusOK,
665665
},
666+
{
667+
name: "GHES with http scheme returns the correct authorization server URL",
668+
host: "http://ghe.example.com",
669+
expectedURL: "http://ghe.example.com/login/oauth",
670+
expectedStatusCode: http.StatusOK,
671+
},
666672
}
667673

668674
for _, tc := range tests {

0 commit comments

Comments
 (0)