fix(api,watcher,server): reject moves non-markdown untouched; read caps; BOM; strict routing flag (review of #211, pass 2)
- brain_reject on a parked pdf/txt moves the bytes; it no longer prepends YAML - raw/ notes are read through a cap (readCapped); an endless reader test fails instead of exhausting memory - a byte-order mark no longer hides a note's wing: key - INGEST_WING_ROUTING is parsed strictly; a typo stops the server rather than leaving routing silently off - tests for the reserved-wing check in every disguise (Sources, sources., ...) Mutation-checked. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -397,6 +397,7 @@ func topDir(rel string) string {
|
||||
// line that is exactly "---"), and an indented `wing:` belongs to some other
|
||||
// mapping, not to the note.
|
||||
func frontmatterWing(content string) string {
|
||||
content = strings.TrimPrefix(content, "\ufeff") // a byte-order mark must not hide the block
|
||||
content = strings.ReplaceAll(content, "\r\n", "\n")
|
||||
if !strings.HasPrefix(content, "---\n") {
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user