Skip to content

[Bug]: 沙箱文件系统下,读取文件内容为base64出现含\n #3966

Open

Description

@joman-jiang

版本:2.1.0-SNAPSHOT
错误:docker ..... base64 '/xx/aa.png' 2 > /dev/null 结果含\n换行

Image Image

Activity

  1. added
    bug
    on Nov 4, 2026
  2. aiyili commented on Nov 15, 2026

    @aiyili
    Contributor

    Claiming. Will trace the sandbox read path (BaseSandboxFilesystem → base64 '<path>' 2>/dev/null) and decode side: the shell's base64 wraps output at 76 columns per POSIX, so the raw stdout contains line breaks; if the decode step feeds the string with embedded newlines to Base64.getMimeDecoder()-incompatible handling (or keeps them in the stored bytes), the persisted content is corrupted. Fix will strip whitespace from the base64 payload before decoding (or switch to the MIME decoder, which tolerates line separators), plus a regression with a binary fixture long enough to force wrapping (>76 base64 chars).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions