From 5220d0e98cefa4fd7b3b9d04e9a52e88d684765a Mon Sep 17 00:00:00 2001 From: Tpt Date: Mon, 7 Oct 2019 15:02:30 +0200 Subject: [PATCH] Server: adds Content-Encoding support --- server/src/main.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server/src/main.rs b/server/src/main.rs index 0efa5662..da7bcea6 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -3,7 +3,7 @@ use clap::Arg; use clap::ArgMatches; use rouille::input::priority_header_preferred; use rouille::url::form_urlencoded; -use rouille::{start_server, Request, Response}; +use rouille::{content_encoding, start_server, Request, Response}; use rudf::sparql::QueryResult; use rudf::sparql::{PreparedQuery, QueryResultSyntax}; use rudf::{ @@ -52,8 +52,11 @@ where println!("Listening for requests at http://{}", &addr); start_server(addr.to_string(), move |request| { - handle_request(request, repository.connection().unwrap(), &addr) - .with_unique_header("Server", SERVER) + content_encoding::apply( + request, + handle_request(request, repository.connection().unwrap(), &addr), + ) + .with_unique_header("Server", SERVER) }) }