Tiny Regex improvements

Summary: Recreation of D22118786, which was so old rebasing died on some lacking meta data. Lands https://github.com/facebook/flipper/pull/1256

Reviewed By: passy

Differential Revision: D24331424

fbshipit-source-id: 65fc5d8bf0242d4266e269716a319d71ce2e2826
This commit is contained in:
Michel Weststrate
2020-10-15 09:20:07 -07:00
committed by Facebook GitHub Bot
parent 6b7b1fab5c
commit 99757622a5
5 changed files with 10 additions and 16 deletions

View File

@@ -54,7 +54,7 @@ const deviceClientCertFile = 'device.crt';
const caSubject = '/C=US/ST=CA/L=Menlo Park/O=Sonar/CN=SonarCA';
const serverSubject = '/C=US/ST=CA/L=Menlo Park/O=Sonar/CN=localhost';
const minCertExpiryWindowSeconds = 24 * 60 * 60;
const allowedAppNameRegex = /^[\w._-]+$/;
const allowedAppNameRegex = /^[\w.-]+$/;
const logTag = 'CertificateProvider';
/*
* RFC2253 specifies the unamiguous x509 subject format.
@@ -395,11 +395,11 @@ export default class CertificateProvider {
.filter((d) => d.foundCsr !== null)
.map((d) => (d.foundCsr ? encodeURI(d.foundCsr) : 'null'));
console.error(`Looking for CSR (url encoded):
${encodeURI(this.santitizeString(csr))}
Found these:
${foundCsrs.join('\n\n')}`);
throw new Error(`No matching device found for app: ${appName}`);
}

View File

@@ -15,7 +15,7 @@
import {UnsupportedError} from './metrics';
import adbkit, {Client} from 'adbkit';
const allowedAppNameRegex = /^[\w._-]+$/;
const allowedAppNameRegex = /^[\w.-]+$/;
const appNotApplicationRegex = /not an application/;
const appNotDebuggableRegex = /debuggable/;
const operationNotPermittedRegex = /not permitted/;