Hi,
today I started playing with GeoServer and was greeted with a non working
layer preview, the html file would be downloaded on disk instead of
being shown.
Tracked back the issue to the get map respose returning null as the
preferred content disposition, and thus having Content-Disposition:
null; file=topp:states.html
in the headers (or something like that, I did not copy it).
The following patch seems to fix it:
diff --git a/src/ows/src/main/java/org/geoserver/ows/Dispatcher.java
b/src/ows/src/main/java/org/geoserver/ows/Dispatche
index 44ed060..6f455a8 100644
--- a/src/ows/src/main/java/org/geoserver/ows/Dispatcher.java
+++ b/src/ows/src/main/java/org/geoserver/ows/Dispatcher.java
@@ -792,6 +792,9 @@ public class Dispatcher extends AbstractController {
}
if (disposition == null) {
disposition =
response.getPreferredDisposition(result, opDescriptor);
+ if(disposition == null) {
+ disposition = Response.DISPOSITION_INLINE;
+ }
}
// this would be a good place to quote the filename
but unsure of
// compatibility - it appears to be the correct way to handle
Generally speaking, either the response is supposed to return a non null
preferred disposition, in which case the dispatcher should cry foul when
a response returns null, or we do the above and have a default in case
the response does not have an opinion
Cheers
Andrea
--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf
-------------------------------------------------------