web route时,返回数据base64编码
This commit is contained in:
@@ -147,7 +147,11 @@ public class RouteAction extends Action {
|
|||||||
if (contents == null) {
|
if (contents == null) {
|
||||||
ByteBuf ackPayload = Unpooled.buffer();
|
ByteBuf ackPayload = Unpooled.buffer();
|
||||||
ackPayload.ensureWritable(1).writeByte(errorCode.getCode());
|
ackPayload.ensureWritable(1).writeByte(errorCode.getCode());
|
||||||
response.setContent(ackPayload);
|
contents = ackPayload.array();
|
||||||
|
}
|
||||||
|
if (base64Response) {
|
||||||
|
byte[] base64Data = Base64.getEncoder().encode(contents);
|
||||||
|
response.setContent(base64Data);
|
||||||
} else {
|
} else {
|
||||||
response.setContent(contents);
|
response.setContent(contents);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user