Skip to content

Commit 8a8cf89

Browse files
committed
Fix a few tiny non-global replace bugs
Not sure if these have had any concrete impact, but I'm pretty confident they're wrong regardless.
1 parent d777bca commit 8a8cf89

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/components/intercept/config/android-device-config.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ const Spacer = styled.div`
6262

6363
function urlSafeBase64(content: string) {
6464
return Buffer.from(content, 'utf8').toString('base64')
65-
.replace('+', '-')
66-
.replace('/', '_');
65+
.replace(/\+/g, '-')
66+
.replace(/\//g, '_');
6767
}
6868

6969
function getConfigRequestIds(eventsStore: EventsStore) {

src/model/api/openapi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ export function getBodySchema(
246246

247247
const schemaKey = _.find<string>(mediaTypeKeys, (key) =>
248248
new RegExp('^' + // Must match at the start
249-
key.replace('*', '.*') // Wildcards to regex wildcard
250-
.replace(/;.*/, '') // Ignore charset etc
249+
key.replace(/\*/g, '.*') // Wildcards to regex wildcard
250+
.replace(/;.*/g, '') // Ignore charset etc
251251
).exec(contentType) !== null
252252
);
253253

0 commit comments

Comments
 (0)