From 26c945ed083f190722d7180b58809696f63ea187 Mon Sep 17 00:00:00 2001 From: Timur Gordon <31495328+timurgordon@users.noreply.github.com> Date: Thu, 21 Aug 2025 11:37:11 +0200 Subject: [PATCH] remove const from default field value --- lib/core/httpconnection/caching.v | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/core/httpconnection/caching.v b/lib/core/httpconnection/caching.v index ad46d605..62fd4936 100644 --- a/lib/core/httpconnection/caching.v +++ b/lib/core/httpconnection/caching.v @@ -5,15 +5,16 @@ import json import net.http { Method } // https://cassiomolin.com/2016/09/09/which-http-status-codes-are-cacheable/ -const default_cacheable_codes = [200, 203, 204, 206, 300, 404, 405, 410, 414, 501] - -const unsafe_http_methods = [Method.put, .patch, .post, .delete] +const ( + default_cacheable_codes = [200, 203, 204, 206, 300, 404, 405, 410, 414, 501] + unsafe_http_methods = [Method.put, .patch, .post, .delete] +) pub struct CacheConfig { pub mut: key string // as used to identity in redis allowable_methods []Method = [.get, .head] - allowable_codes []int = default_cacheable_codes + allowable_codes []int = [200, 203, 204, 206, 300, 404, 405, 410, 414, 501] // TODO: produces v compiler error to use const disable bool = true // default cache is not working expire_after int = 3600 // default expire_after is 1h match_headers bool // cache the request header to be matched later