1
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-16 21:56:40 -05:00

admin: Fix regex for removing @id fields (closes #3187)

This commit is contained in:
Matthew Holt 2020-03-24 10:52:05 -06:00
parent 341d4fb805
commit 95b2863df2
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5

View file

@ -776,7 +776,7 @@ var (
// in the config. It also matches adjacent commas so that syntax
// can be preserved no matter where in the object the field appears.
// It supports string and most numeric values.
var idRegexp = regexp.MustCompile(`(?m),?\s*"` + idKey + `":\s?(-?[0-9]+(\.[0-9]+)?|(?U)".*")\s*,?`)
var idRegexp = regexp.MustCompile(`(?m),?\s*"` + idKey + `"\s*:\s*(-?[0-9]+(\.[0-9]+)?|(?U)".*")\s*,?`)
const (
rawConfigKey = "config"