From 4a02e63779686d3fe195b4b85ae1a621b03f2ebc Mon Sep 17 00:00:00 2001 From: jfarcand Date: Wed, 30 Oct 2013 10:35:05 -0400 Subject: [PATCH] More fixes for #1338: Add a special client header --- .../main/java/org/atmosphere/cpr/AsynchronousProcessor.java | 5 +++++ .../cpr/src/main/java/org/atmosphere/cpr/HeaderConfig.java | 2 ++ 2 files changed, 7 insertions(+) diff --git a/modules/cpr/src/main/java/org/atmosphere/cpr/AsynchronousProcessor.java b/modules/cpr/src/main/java/org/atmosphere/cpr/AsynchronousProcessor.java index 330dc880719..1d7c9892141 100755 --- a/modules/cpr/src/main/java/org/atmosphere/cpr/AsynchronousProcessor.java +++ b/modules/cpr/src/main/java/org/atmosphere/cpr/AsynchronousProcessor.java @@ -207,6 +207,11 @@ Action action(AtmosphereRequest req, AtmosphereResponse res) throws IOException, } AtmosphereResourceImpl resource = configureWorkflow(null, handlerWrapper, req, res); + String v = req.getHeader(HeaderConfig.X_ATMO_BINARY); + if (v != null) { + resource.forceBinaryWrite(Boolean.valueOf(v)); + } + // Globally defined Action a = invokeInterceptors(config.framework().interceptors(), resource); if (a.type() != Action.TYPE.CONTINUE) { diff --git a/modules/cpr/src/main/java/org/atmosphere/cpr/HeaderConfig.java b/modules/cpr/src/main/java/org/atmosphere/cpr/HeaderConfig.java index 1d4b7956ac2..81713e14a82 100644 --- a/modules/cpr/src/main/java/org/atmosphere/cpr/HeaderConfig.java +++ b/modules/cpr/src/main/java/org/atmosphere/cpr/HeaderConfig.java @@ -84,4 +84,6 @@ public interface HeaderConfig { String ATMOSPHERE_POST_BODY = "X-Atmosphere-Post-Body"; String X_ATMO_PROTOCOL = "X-atmo-protocol"; + + String X_ATMO_BINARY = "X-Atmosphere-Binary"; }