@@ -1149,7 +1149,6 @@ WebSocketChannel::WebSocketChannel()
1149
1149
mInnerWindowID(0 ),
1150
1150
mGotUpgradeOK(0 ),
1151
1151
mRecvdHttpUpgradeTransport(0 ),
1152
- mAutoFollowRedirects(0 ),
1153
1152
mAllowPMCE(1 ),
1154
1153
mPingOutstanding(0 ),
1155
1154
mReleaseOnTransmit(0 ),
@@ -3168,20 +3167,17 @@ WebSocketChannel::AsyncOnChannelRedirect(
3168
3167
// newuri is expected to be http or https
3169
3168
bool newuriIsHttps = newuri->SchemeIs (" https" );
3170
3169
3171
- if (!mAutoFollowRedirects ) {
3172
- // Even if redirects configured off, still allow them for HTTP Strict
3173
- // Transport Security (from ws://FOO to https://FOO (mapped to wss://FOO)
3174
-
3175
- if (!(flags & (nsIChannelEventSink::REDIRECT_INTERNAL |
3176
- nsIChannelEventSink::REDIRECT_STS_UPGRADE))) {
3177
- nsAutoCString newSpec;
3178
- rv = newuri->GetSpec (newSpec);
3179
- NS_ENSURE_SUCCESS (rv, rv);
3170
+ // allow insecure->secure redirects for HTTP Strict Transport Security (from
3171
+ // ws://FOO to https://FOO (mapped to wss://FOO)
3172
+ if (!(flags & (nsIChannelEventSink::REDIRECT_INTERNAL |
3173
+ nsIChannelEventSink::REDIRECT_STS_UPGRADE))) {
3174
+ nsAutoCString newSpec;
3175
+ rv = newuri->GetSpec (newSpec);
3176
+ NS_ENSURE_SUCCESS (rv, rv);
3180
3177
3181
- LOG ((" WebSocketChannel: Redirect to %s denied by configuration\n " ,
3182
- newSpec.get ()));
3183
- return NS_ERROR_FAILURE;
3184
- }
3178
+ LOG ((" WebSocketChannel: Redirect to %s denied by configuration\n " ,
3179
+ newSpec.get ()));
3180
+ return NS_ERROR_FAILURE;
3185
3181
}
3186
3182
3187
3183
if (mEncrypted && !newuriIsHttps) {
@@ -3455,11 +3451,6 @@ WebSocketChannel::AsyncOpenNative(nsIURI* aURI, const nsACString& aOrigin,
3455
3451
if (NS_SUCCEEDED(rv)) {
3456
3452
mAllowPMCE = boolpref ? 1 : 0 ;
3457
3453
}
3458
- rv = prefService->GetBoolPref (
3459
- " network.websocket.auto-follow-http-redirects" , &boolpref);
3460
- if (NS_SUCCEEDED(rv)) {
3461
- mAutoFollowRedirects = boolpref ? 1 : 0 ;
3462
- }
3463
3454
rv = prefService->GetIntPref (" network.websocket.max-connections" , &intpref);
3464
3455
if (NS_SUCCEEDED(rv)) {
3465
3456
mMaxConcurrentConnections = clamped (intpref, 1 , 0xffff );
0 commit comments