Skip to content

Commit da83d8b

Browse files
committed
Added correct content types in showcase-transform
1 parent 12678ee commit da83d8b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎showcase/transform/src/main/java/org/ocpsoft/rewrite/showcase/transform/TransformConfigurationProvider.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.ocpsoft.rewrite.servlet.config.HttpConfigurationProvider;
2525
import org.ocpsoft.rewrite.servlet.config.Path;
2626
import org.ocpsoft.rewrite.servlet.config.Resource;
27+
import org.ocpsoft.rewrite.servlet.config.Response;
2728
import org.ocpsoft.rewrite.transform.Transform;
2829
import org.ocpsoft.rewrite.transform.less.Less;
2930
import org.ocpsoft.rewrite.transform.markup.Asciidoc;
@@ -45,6 +46,7 @@ public Configuration getConfiguration(ServletContext context)
4546
.and(Path.matches("/markdown/{name}.html"))
4647
.and(Resource.exists("/markdown/{name}.md")))
4748
.perform(Forward.to("/markdown/{name}.md")
49+
.and(Response.setContentType("text/html"))
4850
.and(Transform.with(Markdown.fullDocument()
4951
.withTitle("Markdown Demo")
5052
.addStylesheet(context.getContextPath() + "/common/bootstrap.css")
@@ -56,6 +58,7 @@ public Configuration getConfiguration(ServletContext context)
5658
.and(Path.matches("/textile/{name}.html"))
5759
.and(Resource.exists("/textile/{name}.textile")))
5860
.perform(Forward.to("/textile/{name}.textile")
61+
.and(Response.setContentType("text/html"))
5962
.and(Transform.with(Textile.fullDocument()
6063
.withTitle("Textile Demo")
6164
.addStylesheet(context.getContextPath() + "/common/bootstrap.css")
@@ -67,6 +70,7 @@ public Configuration getConfiguration(ServletContext context)
6770
.and(Path.matches("/asciidoc/{name}.html"))
6871
.and(Resource.exists("/asciidoc/{name}.asciidoc")))
6972
.perform(Forward.to("/asciidoc/{name}.asciidoc")
73+
.and(Response.setContentType("text/html"))
7074
.and(Transform.with(Asciidoc.fullDocument()
7175
.withTitle("AsciiDoc Demo")
7276
.addStylesheet(context.getContextPath() + "/common/bootstrap.css")
@@ -78,6 +82,7 @@ public Configuration getConfiguration(ServletContext context)
7882
.and(Path.matches("/less/{name}.css"))
7983
.and(Resource.exists("/less/{name}.less")))
8084
.perform(Forward.to("/less/{name}.less")
85+
.and(Response.setContentType("text/css"))
8186
.and(Transform.with(Less.compiler())))
8287

8388
// Sass
@@ -86,6 +91,7 @@ public Configuration getConfiguration(ServletContext context)
8691
.and(Path.matches("/sass/{name}.css"))
8792
.and(Resource.exists("/sass/{name}.scss")))
8893
.perform(Forward.to("/sass/{name}.scss")
94+
.and(Response.setContentType("text/css"))
8995
.and(Transform.with(Sass.compiler())));
9096

9197
}

0 commit comments

Comments
 (0)