fix
This commit is contained in:
@@ -31,6 +31,21 @@ type LocalizedFields struct {
|
||||
// LocalizedContent is language-code → per-language product output fields.
|
||||
type LocalizedContent map[string]LocalizedFields
|
||||
|
||||
// Public returns a copy safe for API/UI clients. Drops enhance_input_hash
|
||||
// (pipeline cache key) so GET product payloads cannot leak job internals.
|
||||
// UpdateProcessedProduct merges from DB, so omitting the hash on GET is safe.
|
||||
func (c LocalizedContent) Public() LocalizedContent {
|
||||
if len(c) == 0 {
|
||||
return c
|
||||
}
|
||||
out := make(LocalizedContent, len(c))
|
||||
for lang, fields := range c {
|
||||
fields.EnhanceInputHash = ""
|
||||
out[lang] = fields
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// SanitizeLangPromptMap validates language codes, sanitizes prompts, and drops empties.
|
||||
// Accepts LangPromptAny ("*") as a shared any-language prompt key.
|
||||
func SanitizeLangPromptMap(in map[string]string, maxRunes int) (LangPromptMap, error) {
|
||||
|
||||
Reference in New Issue
Block a user