Bug 1357121 - Allow dashes and underscore in OTA distribution name. r?nalexander
MozReview-Commit-ID: 9PchGiKPGLi
--- a/mobile/android/base/java/org/mozilla/gecko/distribution/Distribution.java
+++ b/mobile/android/base/java/org/mozilla/gecko/distribution/Distribution.java
@@ -873,17 +873,17 @@ public class Distribution {
private URI getReferredDistribution(ReferrerDescriptor descriptor) {
final String content = descriptor.content;
if (content == null) {
return null;
}
// We restrict here to avoid injection attacks. After all,
// we're downloading a distribution payload based on intent input.
- if (!content.matches("^[a-zA-Z0-9]+$")) {
+ if (!content.matches("^[a-zA-Z0-9_-]+$")) {
Log.e(LOGTAG, "Invalid referrer content: " + content);
Telemetry.addToHistogram(HISTOGRAM_REFERRER_INVALID, 1);
return null;
}
try {
return new URI(FETCH_PROTOCOL, FETCH_HOSTNAME, FETCH_PATH + content + FETCH_EXTENSION, null);
} catch (URISyntaxException e) {