From 93d27b0b9f9db40c300b57ece3380308053e8203 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 3 Aug 2019 15:16:26 +0300 Subject: [PATCH] vweb assets: the assets cache files are now immutable after creation. (#1454) --- vlib/vweb/assets/assets.v | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vlib/vweb/assets/assets.v b/vlib/vweb/assets/assets.v index c019a2af24..2dc6deacc1 100644 --- a/vlib/vweb/assets/assets.v +++ b/vlib/vweb/assets/assets.v @@ -77,13 +77,13 @@ fn (am mut AssetManager) combine(asset_type string, to_file bool) string { mut out := '' // use cache if os.file_exists(out_file) { + if to_file { + return out_file + } cached := os.read_file(out_file) or { return '' } - out = cached - if !to_file { - return out - } + return cached } // rebuild for asset in am.get_assets(asset_type) {