Open mxku opened 4 years ago
Same issue with 2.2.3.RELEASE as well.
Can you provide your configuration?
spring:
main:
allow-bean-definition-overriding: true
aop:
proxy-target-class: true
cloud:
gateway:
discovery:
locator:
enabled: true
lower-case-service-id: true
httpclient:
ssl:
useInsecureTrustManager: true
x-forwarded:
enabled: true
for-enabled: true
proto-enabled: true
host-append: false
port-append: false
proto-append: false
loadbalancer:
ribbon:
enabled: false
Route::
- id: cas
uri: http://x.x.x.100:9001
filters:
- TokenValidation=authObjects,""
predicates:
- Path=/xxxRestService/**
TokenValidation is a custom filter which injects a header. This is present in old gateway with version 2.0.1.RELEASE as well. Downstream service instance is also same. Gateway v 2.0.1.RELEASE can get the response successfully while v2.2.2.RELEASE and 2.2.3.RELEASE can't
Further, with TRACE logging enabled, I see couple of these stack traces
Apparently the issue is because of Content-Length : 0
being set for a GET request. When this header is not sent to downstream service, it works fine.
GET /xxxRestService/pricingPolicies HTTP/1.0
Host: xxx
Connection: close
Content-Length: 0
Pragma: no-cache
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8,hi;q=0.7
Authorization: Bearer xxx
Content-Type: application/json;charset=UTF-8
Accept: application/json, text/plain, */*
Cache-Control: no-cache
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36
secTokenId: xxxx
Accept-Encoding: gzip, deflate
x-ov-claims: xxxx
Forwarded: proto=http;host="x.x.x.189:8000";for="x.x.x..189:58877"
X-Forwarded-For: x.x.x..189
X-Forwarded-Proto: http
X-Forwarded-Port: 8000
X-Forwarded-Host: x.x.x..189:8000
There is a related discussion in reactor-netty already. Link
@spencergibb Is there a way to stop setting Content-Length: 0 ?
I am hitting a service through spring-cloud-gateway. Expected response size is 359594. But while hitting it through spring-cloud-gateway, response is marked complete after 262144 bytes.
This works fine with spring-cloud-gateway 2.0.1.RELEASE sprign-webflux: 5.0.6.RELEASE reactor-netty: 0.7.11.RELEASE
AccessLog:
Wiretap Below is the full wiretap log for that particular call.