Skip to content

Commit 9ff25ab

Browse files
Copilotnomeguy
andcommitted
Add explicit URL scheme assignments in tests for reliability
Co-authored-by: nomeguy <85475922+nomeguy@users.noreply.github.com>
1 parent 32ae85f commit 9ff25ab

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

service/cookie_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ func TestCaptchaCookieAttributes(t *testing.T) {
2929

3030
// Create a test request with HTTPS scheme
3131
r := httptest.NewRequest("GET", "https://example.com/test", nil)
32+
// Explicitly set scheme to ensure test reliability
33+
r.URL.Scheme = "https"
3234

3335
// Set a test captcha cookie
3436
uuidStr := "test-uuid-123"
@@ -74,6 +76,8 @@ func TestCaptchaCookieAttributesHTTP(t *testing.T) {
7476

7577
// Create a test request with HTTP scheme
7678
r := httptest.NewRequest("GET", "http://example.com/test", nil)
79+
// Explicitly set scheme to ensure test reliability
80+
r.URL.Scheme = "http"
7781

7882
// Set a test captcha cookie
7983
uuidStr := "test-uuid-123"
@@ -114,6 +118,8 @@ func TestOAuthCookieAttributes(t *testing.T) {
114118

115119
// Create a test request with HTTPS scheme
116120
r := httptest.NewRequest("GET", "https://example.com/test", nil)
121+
// Explicitly set scheme to ensure test reliability
122+
r.URL.Scheme = "https"
117123

118124
// Set a test OAuth access token cookie
119125
cookie := &http.Cookie{

0 commit comments

Comments
 (0)