Skip to content

Fix POST static map option parsing - #2361

Draft
miakh wants to merge 2 commits into
maptiler:masterfrom
miakh:fix/2201-static-post-style-params
Draft

Fix POST static map option parsing#2361
miakh wants to merge 2 commits into
maptiler:masterfrom
miakh:fix/2201-static-post-style-params

Conversation

@miakh

@miakh miakh commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #2201.

POST JSON bodies can contain null optional fields. The merge treated those as real duplicate values, turning a query value such as border=white into an array and producing the reported invalid color warning. This change ignores nulls and normalizes the usual camelCase spellings of multi-word JSON options before the existing allowlist and merge logic run.

The regression tests compare the rendered PNGs, covering both lineCap/lineJoin from the body and query options alongside null body fields. Existing repeated path and marker behavior remains unchanged.

Validation:

  • npm run lint:js
  • npm run lint:yml
  • npx mocha test/setup.js test/static.js --timeout 10000 --exit (64 passing)
  • npm test (249 passing; the existing static-bearing-pitch fixture is 131 pixels over a 100-pixel threshold on macOS arm64, identically on upstream/master)

@miakh
miakh marked this pull request as draft September 9, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

border query parameter is parsed wrong? static/auto/

1 participant