igrigorik / em-http-request

Asynchronous HTTP Client (EventMachine + Ruby)
1.22k stars 220 forks source link

Change conn.connopts.https when sheme changed when redirect #335

Closed leksito closed 4 years ago

leksito commented 4 years ago

When url scheme is changed when redirect (e. g. https -> http) https property of conn.connopts should be changed too. CONNECT method is used by default for https connections , when redirecting to http url, CONNECT method will be used too, because connopts is copied from previous connection. This behavior is wrong, because CONNECT method cant be used for http.