Skip to content

Commit

Permalink
do not add \r if already has it
Browse files Browse the repository at this point in the history
  • Loading branch information
jkwlui committed Sep 27, 2018
1 parent b00bf42 commit acd6eb0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/test.media.ts
Expand Up @@ -37,7 +37,7 @@ async function testMultpart(drive: drive_v2.Drive) {
res.request.headers['content-type'].indexOf('multipart/related;'), 0);
const boundary =
res.request.headers['content-type'].replace(boundaryPrefix, '');
expectedResp = expectedResp.replace(/\n/g, '\r\n')
expectedResp = expectedResp.replace(/\r?\n/g, '\r\n')
.replace(/\$boundary/g, boundary)
.replace('$media', media.body)
.replace('$resource', JSON.stringify(requestBody))
Expand All @@ -61,7 +61,7 @@ async function testMediaBody(drive: drive_v2.Drive) {
res.request.headers['content-type'].indexOf('multipart/related;'), 0);
const boundary =
res.request.headers['content-type'].replace(boundaryPrefix, '');
expectedResp = expectedResp.replace(/\n/g, '\r\n')
expectedResp = expectedResp.replace(/\r?\n/g, '\r\n')
.replace(/\$boundary/g, boundary)
.replace('$media', media.body)
.replace('$resource', JSON.stringify(requestBody))
Expand Down Expand Up @@ -309,7 +309,7 @@ describe('Media', () => {
{userId: 'me', requestBody, media});
const boundary =
res.request.headers['content-type'].replace(boundaryPrefix, '');
expectedBody = expectedBody.replace(/\n/g, '\r\n')
expectedBody = expectedBody.replace(/\r?\n/g, '\r\n')
.replace(/\$boundary/g, boundary)
.replace('$media', bodyString)
.replace('$resource', JSON.stringify(requestBody))
Expand All @@ -332,7 +332,7 @@ describe('Media', () => {
{userId: 'me', requestBody, media});
const boundary2 =
res2.request.headers['content-type'].replace(boundaryPrefix, '');
expectedBody = expectedBody.replace(/\n/g, '\r\n')
expectedBody = expectedBody.replace(/\r?\n/g, '\r\n')
.replace(/\$boundary/g, boundary2)
.replace('$media', bodyString)
.replace('$resource', JSON.stringify(requestBody))
Expand Down

0 comments on commit acd6eb0

Please sign in to comment.