Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix download extensions pattern #247

Conversation

piaolingxue
Copy link

when the param in link contains download extensions, it will match the old downlod extensions pattern.
eg.

var downloadExtensionsPattern = new RegExp('\.(' + 'jpg' + ')([?&#]|$)', 'i');
// the result will be true
downloadExtensionsPattern.test('http://hello.world.com?url=image.jpg');

// if we fix the download extensions pattern as follows
var downloadExtensionsPattern = new RegExp('^[^\\?]+\.(' + 'jpg' + ')([?&#]|$)', 'i');
// then it will be false
downloadExtensionsPattern.test('http://hello.world.com?url=image.jpg');

Although I think the better solution is to support customizing the downloadExtensionsPattern.

@mattab
Copy link
Member

mattab commented Mar 26, 2014

see: https://travis-ci.org/piwik/piwik/jobs/21567451
it fails the build "download file.zip (is param) "
because actually this feature is by design... so won't fix

PS: you can already customise the download extensions: http://developer.piwik.org/api-reference/tracking-javascript#changing-the-list-of-file-extensions-to-track-as-downloads

@mattab mattab closed this Mar 26, 2014
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.

None yet

2 participants