Skip to content

Data is Getting Encoded while returning response as HTML #1880

Closed
@vijay8059

Description

@vijay8059

🐛 Bug Report

While Returning the response as content-type : application/html data is getting encoded

To Reproduce

Set the headers
header := metadata.Pairs("X-Content-Type", "application/html")
grpc.SetHeader(ctx, header)
Steps :
rpc Create (RegId) returns (Resp);
message RegId {
string id = 1;
}

message Resp {
string response = 1;
}
Above is my proto definition, in the response i am sending the <html><b> Hey Developer </b></html> but it's retuning response as. {"response":"\u003chtml\u003e\u003cb\u003e Hey Developer \u003c/b\u003e\u003c/html\u003e"}

Expected behavior

{"response":" Hey Developer "}

And also is there is a way to return just the value as response instead of key value pair, something like this " Hey Developer "

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions