Skip to content

fix(composer): support slashes in dist download version routes#85

Merged
maartenbode merged 1 commit intopricorephp:mainfrom
joenivl:fix/dist-download-slash-versions
Mar 31, 2026
Merged

fix(composer): support slashes in dist download version routes#85
maartenbode merged 1 commit intopricorephp:mainfrom
joenivl:fix/dist-download-slash-versions

Conversation

@joenivl
Copy link
Copy Markdown
Contributor

@joenivl joenivl commented Mar 31, 2026

Summary

  • Fix dist download route to support branch versions containing slashes (e.g. dev-feat/ZON-185967-add-db-storage)
  • Add regex constraints for version and reference route parameters
  • Add test case for branch version downloads with slashes

Problem

Composer dev branch versions like dev-feat/my-feature contain forward slashes. When used in the dist download URL, Laravel's router splits the version on /, breaking parameter matching and returning
a 404.

Solution

Added where constraints to the dist download route:

  • version: [a-zA-Z0-9_./-]+ — allows slashes
  • reference: [a-f0-9]+ — restricted to hex (git SHA), so Laravel can distinguish version from reference

Test plan

  • Existing dist download tests still pass
  • New test: downloads dist for branch version with slashes
  • Manually verified with curl against local Pricore instance

@joenivl joenivl marked this pull request as ready for review March 31, 2026 09:43
@maartenbode
Copy link
Copy Markdown
Member

Thanks for the contribution, Jeroen! Clean fix and nice test coverage. All tests pass. 👍

@maartenbode maartenbode merged commit ae494cd into pricorephp:main Mar 31, 2026
2 checks passed
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.

2 participants