mirror of
https://github.com/google/nomulus.git
synced 2025-05-19 02:39:34 +02:00
Set the MIME type BEFORE the payload
When we set the payload, it is converted to bytes using the response's character set. Changing the MIME type later has no effect on the conversion to bytes, even though it does change the returned MIME type. This results in bytes that were encoded using one character set while the response reports a different character set. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=196258752
This commit is contained in:
parent
c007458e1a
commit
c25f765fc5
2 changed files with 2 additions and 1 deletions
|
@ -60,6 +60,7 @@ public final class FakeResponse implements Response {
|
|||
|
||||
@Override
|
||||
public void setContentType(MediaType contentType) {
|
||||
checkArgument(payload.isEmpty(), "setContentType must be called before setPayload");
|
||||
this.contentType = checkNotNull(contentType);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue