/** * Set the default content encoding for text related files. This allows overriding the system settings default value. * @param contentEncoding the desired content encoding e.g.: "UTF-8" * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.ext.web.handler.StaticHandler setDefaultContentEncoding(String contentEncoding) { delegate.setDefaultContentEncoding(contentEncoding); return this; }
/** * Set the default content encoding for text related files. This allows overriding the system settings default value. * @param contentEncoding the desired content encoding e.g.: "UTF-8" * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.ext.web.handler.StaticHandler setDefaultContentEncoding(String contentEncoding) { delegate.setDefaultContentEncoding(contentEncoding); return this; }
@Test public void testChangeDefaultContentEncoding() throws Exception { stat.setDefaultContentEncoding("ISO-8859-1"); testRequest(HttpMethod.GET, "/otherpage.html", null, res -> { String contentType = res.headers().get("Content-Type"); assertEquals("text/html;charset=ISO-8859-1", contentType); }, 200, "OK", "<html><body>Other page</body></html>"); }
@Test public void testChangeDefaultContentEncoding() throws Exception { stat.setDefaultContentEncoding("ISO-8859-1"); testRequest(HttpMethod.GET, "/otherpage.html", null, res -> { String contentType = res.headers().get("Content-Type"); assertEquals("text/html;charset=ISO-8859-1", contentType); }, 200, "OK", "<html><body>Other page</body></html>"); }