From: Michael Tremer Date: Thu, 9 Mar 2023 18:49:59 +0000 (+0000) Subject: web: Correctly deliver repository configuration X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ac71763bd821af03204e1f4794ceeef16c9366ff;p=pbs.git web: Correctly deliver repository configuration Signed-off-by: Michael Tremer --- diff --git a/src/web/repos.py b/src/web/repos.py index 8af6a636..06782e30 100644 --- a/src/web/repos.py +++ b/src/web/repos.py @@ -19,6 +19,7 @@ # # ############################################################################### +import configparser import tornado.web from . import base @@ -107,15 +108,17 @@ class ConfigHandler(BaseHandler): # Fetch the repository repo = self._get_repo(**kwargs) - # This is plain text - self.set_header("Content-Type", "text/plain") - # Generate configuration + config = configparser.ConfigParser(interpolation=None) + with self.db.transaction(): - config = repo._make_config() + repo.write_config(config) + + # This is plain text + self.set_header("Content-Type", "text/plain") # Send it to the client - self.finish(config) + config.write(self) class EditHandler(BaseHandler):