equal
deleted
inserted
replaced
118 } else { |
118 } else { |
119 HttpRequestBuilderImpl.checkURI(requestURI); |
119 HttpRequestBuilderImpl.checkURI(requestURI); |
120 checkTimeout(timeout); |
120 checkTimeout(timeout); |
121 this.systemHeadersBuilder = new HttpHeadersBuilder(); |
121 this.systemHeadersBuilder = new HttpHeadersBuilder(); |
122 } |
122 } |
123 this.systemHeadersBuilder.setHeader("User-Agent", USER_AGENT); |
123 if (!userHeaders.firstValue("User-Agent").isPresent()) { |
|
124 this.systemHeadersBuilder.setHeader("User-Agent", USER_AGENT); |
|
125 } |
124 this.uri = requestURI; |
126 this.uri = requestURI; |
125 if (isWebSocket) { |
127 if (isWebSocket) { |
126 // WebSocket determines and sets the proxy itself |
128 // WebSocket determines and sets the proxy itself |
127 this.proxy = ((HttpRequestImpl) request).proxy; |
129 this.proxy = ((HttpRequestImpl) request).proxy; |
128 } else { |
130 } else { |
168 assert method == null || Utils.isValidName(method); |
170 assert method == null || Utils.isValidName(method); |
169 this.method = method == null? "GET" : method; |
171 this.method = method == null? "GET" : method; |
170 this.userHeaders = other.userHeaders; |
172 this.userHeaders = other.userHeaders; |
171 this.isWebSocket = other.isWebSocket; |
173 this.isWebSocket = other.isWebSocket; |
172 this.systemHeadersBuilder = new HttpHeadersBuilder(); |
174 this.systemHeadersBuilder = new HttpHeadersBuilder(); |
173 this.systemHeadersBuilder.setHeader("User-Agent", USER_AGENT); |
175 if (!userHeaders.firstValue("User-Agent").isPresent()) { |
|
176 this.systemHeadersBuilder.setHeader("User-Agent", USER_AGENT); |
|
177 } |
174 this.uri = uri; |
178 this.uri = uri; |
175 this.proxy = other.proxy; |
179 this.proxy = other.proxy; |
176 this.expectContinue = other.expectContinue; |
180 this.expectContinue = other.expectContinue; |
177 this.secure = uri.getScheme().toLowerCase(Locale.US).equals("https"); |
181 this.secure = uri.getScheme().toLowerCase(Locale.US).equals("https"); |
178 this.requestPublisher = other.requestPublisher; // may be null |
182 this.requestPublisher = other.requestPublisher; // may be null |