mirror of
https://github.com/skogaby/butterfly.git
synced 2026-04-25 16:06:52 -05:00
Send the 'real' (static) response for events. Don't compress responses for now, apparently this is somehow subtly broken and the client is rejecting very large responses that we've compressed
This commit is contained in:
parent
25244e2fe5
commit
9185ba7967
|
|
@ -110,8 +110,9 @@ public abstract class BaseRequestHandler {
|
|||
respBytes = BinaryXmlUtils.xmlToBinary(respBytes);
|
||||
}
|
||||
|
||||
// TODO: FIX THIS SHIT
|
||||
// compress if needed
|
||||
final String compressionScheme = request.headers(COMPRESSION_HEADER);
|
||||
/*final String compressionScheme = request.headers(COMPRESSION_HEADER);
|
||||
|
||||
if (!StringUtils.isBlank(compressionScheme) &&
|
||||
compressionScheme.equals(LZ77_COMPRESSION)) {
|
||||
|
|
@ -119,7 +120,10 @@ public abstract class BaseRequestHandler {
|
|||
response.header(COMPRESSION_HEADER, LZ77_COMPRESSION);
|
||||
} else {
|
||||
response.header(COMPRESSION_HEADER, "none");
|
||||
}
|
||||
}*/
|
||||
|
||||
// TODO: For some reason this is breaking on very large responses (i.e. events). Fix later, leave uncompressed for now.
|
||||
response.header(COMPRESSION_HEADER, "none");
|
||||
|
||||
// encrypt if needed
|
||||
final String encryptionKey = request.headers(CRYPT_KEY_HEADER);
|
||||
|
|
|
|||
|
|
@ -65,16 +65,8 @@ public class PlayerDataRequestHandler extends BaseRequestHandler {
|
|||
*/
|
||||
private Object handleEventsRequest(final Request request, final Response response) {
|
||||
if (this.getSanitizedModel(request.attribute("model")).equals("mdx_2018042300")) {
|
||||
// TODO: This is almost *definitely* not supposed to be a static response. That being
|
||||
// said, loading the file directly and sending it isn't working out, so I need
|
||||
// to recreate the events response via code, unfortunately. In the meantime,
|
||||
// send an empty response...
|
||||
final KXmlBuilder respBuilder = KXmlBuilder.create("response")
|
||||
.e("playerdata")
|
||||
.s32("result", 0).up()
|
||||
.bool("is_new", false);
|
||||
|
||||
return this.sendResponse(request, response, respBuilder);
|
||||
// TODO: This is almost *definitely* not supposed to be a static response
|
||||
return this.sendStaticResponse(request, response, "static_responses/mdx_2018042300/events.xml");
|
||||
} else {
|
||||
throw new UnsupportedRequestException();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user