Skip to content

fix(maas): normalize base64 inputs and accept small documents - #250

Open
itzKLAUS wants to merge 1 commit into
zai-org:mainfrom
itzKLAUS:fix/maas-base64-normalization
Open

itzKLAUS wants to merge 1 commit into
zai-org:mainfrom
itzKLAUS:fix/maas-base64-normalization

Conversation

@itzKLAUS

@itzKLAUS itzKLAUS commented Oct 8, 2026

Copy link
Copy Markdown

MaaS base64 document inputs can be rejected as filenames or sent without normalized padding. Strip the optional prefix before detection, accept short payloads only when they have a recognizable document signature, and emit the normalized payload used for MIME detection.

Add tests for a real small PNG in raw, unpadded, wrapped and prefixed forms, plus ordinary filename, local PDF and URL controls.

Validation: 141 unit tests passed, 22 optional tests skipped (pytest glmocr/tests/test_maas_base64_inputs.py glmocr/tests/test_unit.py -q). All repository pre-commit checks pass. The four new image-input cases fail on the original code. No cloud OCR or model inference was performed.

Fixes #249

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(maas): normalize base64 inputs and accept small documents

2 participants