serve static assets on urls with file extension #538
2 changed files with 4 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
|||
const EMBED = 'EMBED';
|
||||
const SERVE = 'SERVE';
|
||||
const SHOW = 'SHOW';
|
||||
|
||||
module.exports = {
|
||||
EMBED,
|
||||
SERVE,
|
||||
SHOW,
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { EMBED, SHOW } = require('../constants/request_types.js');
|
||||
const { SERVE, SHOW } = require('../constants/request_types.js');
|
||||
|
||||
function clientWantsAsset ({accept, range}) {
|
||||
const imageIsWanted = accept && accept.match(/image\/.*/) && !accept.match(/text\/html/);
|
||||
|
@ -8,7 +8,7 @@ function clientWantsAsset ({accept, range}) {
|
|||
|
||||
const determineRequestType = (hasFileExtension, headers) => {
|
||||
if (hasFileExtension || clientWantsAsset(headers)) {
|
||||
return EMBED;
|
||||
return SERVE;
|
||||
}
|
||||
return SHOW;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue