mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-25 17:04:16 +00:00
feature(package) win32 v6.0.0
This commit is contained in:
parent
fec91e7093
commit
89af33fb9d
4 changed files with 18 additions and 1 deletions
1
server/fixture/route.js
Normal file
1
server/fixture/route.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
hello
|
||||
|
|
@ -95,6 +95,7 @@ async function route({config, options, request, response}) {
|
|||
}
|
||||
|
||||
response.setHeader('Content-Type', contentType(extname(fullPath)));
|
||||
//response.setHeader('Content-Length', contentLength);
|
||||
|
||||
await pipe([
|
||||
stream,
|
||||
|
|
|
|||
|
|
@ -411,3 +411,18 @@ test('cloudcmd: route: dropbox', async (t) => {
|
|||
t.end();
|
||||
});
|
||||
|
||||
test('cloudcmd: route: content type', async (t) => {
|
||||
const options = {
|
||||
root: fixtureDir,
|
||||
};
|
||||
|
||||
const {headers} = await request.get('/route.js', {
|
||||
options,
|
||||
});
|
||||
|
||||
const result = headers.get('content-length');
|
||||
|
||||
t.equal(result, '78');
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue