-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Tobias Salzmann <[email protected]> Co-authored-by: tts-sdrissen <[email protected]>
- Loading branch information
1 parent
71ceb19
commit 46b4de0
Showing
8 changed files
with
241 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const http = require('http'); | ||
const fs = require('fs'); | ||
const process = require('process'); | ||
|
||
const options = { | ||
hostname: 'localhost', | ||
port: 9090, | ||
path: '/', | ||
method: 'GET' | ||
}; | ||
|
||
|
||
const req = http.request(options, res => { | ||
if (res.statusCode !== 405) { | ||
console.error(`expected 405, got ${res.statusCode}`); | ||
process.exit(1); | ||
return; | ||
} | ||
const buf = 'Method Not Allowed'; | ||
let allTheData = ""; | ||
|
||
res.on('data', d => { | ||
allTheData += d.toString(); | ||
}); | ||
|
||
res.on('end', () => { | ||
if (allTheData !== buf) { | ||
console.error(`expected ${buf}, but got ${allTheData}`); | ||
process.exit(1); | ||
return; | ||
} | ||
}); | ||
}) | ||
|
||
req.on('error', error => { | ||
console.error(error); | ||
process.exit(1); | ||
return; | ||
}); | ||
|
||
req.end(); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
const http = require('http'); | ||
const fs = require('fs'); | ||
const process = require('process'); | ||
|
||
const options = { | ||
hostname: 'localhost', | ||
port: 9090, | ||
path: '/', | ||
method: 'GET' | ||
}; | ||
|
||
|
||
const buf = fs.readFileSync('.github/PULL_REQUEST_TEMPLATE.md').toString(); | ||
|
||
const req = http.request(options, res => { | ||
if (res.statusCode !== 200) { | ||
console.error(`expected 200, got ${res.statusCode}`); | ||
process.exit(1); | ||
return; | ||
} | ||
|
||
if (res.headers['content-length'] !== buf.length.toString()) { | ||
console.error(`expected ${buf.length}, got ${res.headers['content-length']}`); | ||
process.exit(1); | ||
return; | ||
} | ||
|
||
|
||
|
||
let allTheData = ""; | ||
|
||
res.on('data', d => { | ||
allTheData += d.toString(); | ||
}); | ||
|
||
res.on('end', () => { | ||
if (allTheData !== buf) { | ||
console.error(`expected ${buf}, but got ${allTheData}`); | ||
process.exit(1); | ||
return; | ||
} | ||
}); | ||
}) | ||
|
||
req.on('error', error => { | ||
console.error(error); | ||
process.exit(1); | ||
return; | ||
}); | ||
|
||
req.end(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.