You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by jm...@apache.org on 2017/01/28 21:15:20 UTC
[1/2] incubator-guacamole-client git commit: GUACAMOLE-129: Set
"Content-Disposition: attachment" for "application/octet-stream" downloads to
ensure browser doesn't attempt mimetype detection.
Repository: incubator-guacamole-client
Updated Branches:
refs/heads/master 0d6500396 -> 72a605559
GUACAMOLE-129: Set "Content-Disposition: attachment" for "application/octet-stream" downloads to ensure browser doesn't attempt mimetype detection.
Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/b32ee2e9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/b32ee2e9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/b32ee2e9
Branch: refs/heads/master
Commit: b32ee2e9e7a6310a681df09db8a1b5fb7de95568
Parents: d8f9d26
Author: Michael Jumper <mj...@apache.org>
Authored: Fri Jan 27 21:15:57 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Fri Jan 27 21:15:57 2017 -0800
----------------------------------------------------------------------
.../org/apache/guacamole/rest/tunnel/StreamResource.java | 10 +++++++++-
.../org/apache/guacamole/rest/tunnel/TunnelResource.java | 2 +-
2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/b32ee2e9/guacamole/src/main/java/org/apache/guacamole/rest/tunnel/StreamResource.java
----------------------------------------------------------------------
diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/tunnel/StreamResource.java b/guacamole/src/main/java/org/apache/guacamole/rest/tunnel/StreamResource.java
index 60e48ec..1dc93b7 100644
--- a/guacamole/src/main/java/org/apache/guacamole/rest/tunnel/StreamResource.java
+++ b/guacamole/src/main/java/org/apache/guacamole/rest/tunnel/StreamResource.java
@@ -28,6 +28,7 @@ import javax.ws.rs.POST;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.ResponseBuilder;
import javax.ws.rs.core.StreamingOutput;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.tunnel.StreamInterceptingTunnel;
@@ -103,7 +104,14 @@ public class StreamResource {
};
- return Response.ok(stream, mediaType).build();
+ // Begin successful response
+ ResponseBuilder responseBuilder = Response.ok(stream, mediaType);
+
+ // Set Content-Disposition header for "application/octet-stream"
+ if (mediaType.equals(MediaType.APPLICATION_OCTET_STREAM))
+ responseBuilder.header("Content-Disposition", "attachment");
+
+ return responseBuilder.build();
}
http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/b32ee2e9/guacamole/src/main/java/org/apache/guacamole/rest/tunnel/TunnelResource.java
----------------------------------------------------------------------
diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/tunnel/TunnelResource.java b/guacamole/src/main/java/org/apache/guacamole/rest/tunnel/TunnelResource.java
index b498527..f435365 100644
--- a/guacamole/src/main/java/org/apache/guacamole/rest/tunnel/TunnelResource.java
+++ b/guacamole/src/main/java/org/apache/guacamole/rest/tunnel/TunnelResource.java
@@ -52,7 +52,7 @@ public class TunnelResource {
* The media type to send as the content type of stream contents if no
* other media type is specified.
*/
- private static final String DEFAULT_MEDIA_TYPE = "application/octet-stream";
+ private static final String DEFAULT_MEDIA_TYPE = MediaType.APPLICATION_OCTET_STREAM;
/**
* The tunnel that this TunnelResource represents.
[2/2] incubator-guacamole-client git commit: GUACAMOLE-129: Merge
addition of new Content-Disposition header.
Posted by jm...@apache.org.
GUACAMOLE-129: Merge addition of new Content-Disposition header.
Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/72a60555
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/72a60555
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/72a60555
Branch: refs/heads/master
Commit: 72a605559aa08b01094e9f4031c475bc85a39f8e
Parents: 0d65003 b32ee2e
Author: James Muehlner <ja...@guac-dev.org>
Authored: Sat Jan 28 13:14:31 2017 -0800
Committer: James Muehlner <ja...@guac-dev.org>
Committed: Sat Jan 28 13:14:31 2017 -0800
----------------------------------------------------------------------
.../org/apache/guacamole/rest/tunnel/StreamResource.java | 10 +++++++++-
.../org/apache/guacamole/rest/tunnel/TunnelResource.java | 2 +-
2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------