Browse Source

Returns databuffer if not netty

pull/1544/head
Spencer Gibb 5 years ago
parent
commit
89cb8a9171
No known key found for this signature in database
GPG Key ID: 7788A47380690861
  1. 10
      spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/ServerWebExchangeUtils.java

10
spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/ServerWebExchangeUtils.java

@ -359,9 +359,13 @@ public final class ServerWebExchangeUtils { @@ -359,9 +359,13 @@ public final class ServerWebExchangeUtils {
// probably == downstream closed
return null;
}
// TODO: deal with Netty
NettyDataBuffer pdb = (NettyDataBuffer) dataBuffer;
return pdb.factory().wrap(pdb.getNativeBuffer().retainedSlice());
if (dataBuffer instanceof NettyDataBuffer) {
NettyDataBuffer buffer = (NettyDataBuffer) dataBuffer;
return buffer.factory()
.wrap(buffer.getNativeBuffer().retainedSlice());
}
// FIXME: is this going to be a problem?
return dataBuffer;
}).flux();
}
};

Loading…
Cancel
Save