Comments (2)
My quick&dirty "fix":
#[Route(
'/zipball/{package}/{hash}',
name: 'download_dist_package',
- requirements: ['package' => '%package_name_regex%', 'hash' => '[a-f0-9]{40}\.[a-z]+?'],
+ requirements: ['package' => '%package_name_regex%', 'hash' => '.+?\.zip'],
methods: ['GET']
)]
public function zipballAction(#[Vars('name')] Package $package, string $hash): Response
{
if ((false === $this->dm->isEnabled() && false === RepTypes::isBuildInDist($package->getRepoType()))
- || !\preg_match('{[a-f0-9]{40}}i', $hash, $match) || !($reference = $match[0])
+ || !\preg_match('{(.+?)\.zip}i', $hash, $match) || !($reference = $match[1])
) {
return $this->createNotFound();
}
After this fix I also had to disable include_archive_checksum
option in config, because sha1 checksums were wrong for Subversion packages . I don't know why yet.
from packeton.
Strangely enough, it works on my development machine, but in docker the starting slash is missing (tags/1.0.1/@3426.zip
instead of /tags/1.0.1/@3426.zip
) so I had to also add:
if (str_contains($reference, '/') && !str_starts_with($reference, '/')) {
$reference = '/' . $reference;
}
I'll analyze later what is the root cause.
from packeton.
Related Issues (20)
- Virtual package
- Allow package to be archived
- System status page
- Add support for optional drivers such as Drupal.org
- "update expiration" funcionality by package HOT 2
- help or clarification - cache and show mirrored packages into directory HOT 5
- Update bootstrap and move JS to ES6 AssetMapper component
- (feat) League oauth2-client bridge adapter to allow use any oauth2 provider
- Support ED25519 ssh key
- Allow to set Cache.SerializerPath for HTMLPurifier
- Full Installation Without Docker HOT 1
- Packeton Without Redis HOT 1
- Generate multiple credentials for API-only users
- GitHub incoming Webhook yields 406 response
- URL could not be accessed (HTTP 403): HTTP/2 403 HOT 1
- /packages.json not found (404) HOT 2
- Cannot submit package, when running on docker (This value should not be blank.) HOT 3
- Add support for a bitbucket datacenter integration
- Suggesters page not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from packeton.