mirror of
https://github.com/NovaGM/ModuleBuilder.git
synced 2024-08-15 00:23:33 +00:00
[Dev] Add URI decoding to server
This commit is contained in:
parent
4268f099b5
commit
a917e6f9a5
1 changed files with 3 additions and 2 deletions
|
@ -51,11 +51,12 @@ const parcelOptions = {
|
|||
};
|
||||
|
||||
createServer((req, res) => {
|
||||
const basedPath = `${distDir}${req.url.split('?').shift().replace(/\.\./g, '')}`;
|
||||
const goodUrl = decodeURI(req.url);
|
||||
const basedPath = `${distDir}${goodUrl.split('?').shift().replace(/\.\./g, '')}`;
|
||||
|
||||
let contentType = 'text/plain';
|
||||
|
||||
switch (req.url.split('.').pop()) {
|
||||
switch (goodUrl.split('.').pop()) {
|
||||
case 'js':
|
||||
contentType = 'text/javascript';
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue