Skip to content

Commit

Permalink
Fix integration tests by running HTTP tests before HTTPS
Browse files Browse the repository at this point in the history
  • Loading branch information
MeenaAlfons committed Nov 29, 2023
1 parent c84c710 commit 5f5f367
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/javascripts/integration/index.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,19 @@ function getTestConfigs() {
testConfigs.push({ transport: "sockjs", forceTLS: true})
testConfigs.push({ transport: "sockjs", forceTLS: false})
}

// Test all forceTLS: false before forceTLS: true
// Because browsers prevent a URL from downgrading from HTTPS to HTTP
// This is probably the result of Strict-Transport-Security header returned when calling the HTTPS endpoint.
testConfigs.sort((a, b) => {
if (a.forceTLS == false && b.forceTLS == true) {
return -1;
} else if (a.forceTLS == true && b.forceTLS == false) {
return 1;
} else {
return 0;
}
})

return testConfigs
}

0 comments on commit 5f5f367

Please sign in to comment.