Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6c2b8d6 authored by Jean-Baptiste Queru's avatar Jean-Baptiste Queru Committed by Android Code Review
Browse files

Merge "Fixed problem with proxy server sometimes responds with 400 Bad Request...

Merge "Fixed problem with proxy server sometimes responds with 400 Bad Request when trying to connect to a site using https."
parents 6af5a9ea ea4e597a
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -202,10 +202,13 @@ public class HttpsConnection extends Connection {
                BasicHttpRequest proxyReq = new BasicHttpRequest
                    ("CONNECT", mHost.toHostString());

                // add all 'proxy' headers from the original request
                // add all 'proxy' headers from the original request, we also need
                // to add 'host' header unless we want proxy to answer us with a
                // 400 Bad Request
                for (Header h : req.mHttpRequest.getAllHeaders()) {
                    String headerName = h.getName().toLowerCase();
                    if (headerName.startsWith("proxy") || headerName.equals("keep-alive")) {
                    if (headerName.startsWith("proxy") || headerName.equals("keep-alive")
                            || headerName.equals("host")) {
                        proxyReq.addHeader(h);
                    }
                }