server: allow user loading svg files
package: v0.49.10
This commit is contained in:
parent
6b0b637f07
commit
c2fad00c23
2 changed files with 4 additions and 4 deletions
|
|
@ -2,7 +2,7 @@
|
|||
"name": "open-stage-control",
|
||||
"productName": "Open Stage Control",
|
||||
"description": "Libre and modular OSC / MIDI controller",
|
||||
"version": "0.49.9",
|
||||
"version": "0.49.10",
|
||||
"author": {
|
||||
"name": "Jean-Emmanuel Doucet",
|
||||
"email": "jean-emmanuel@ammd.net"
|
||||
|
|
|
|||
|
|
@ -52,15 +52,15 @@ function httpRoute(req, res) {
|
|||
url = url.replace('_:_', ':') // escaped drive colon
|
||||
url = url.replace(/^\/([^/]*:)/, '$1') // strip leading slash
|
||||
|
||||
if (url.match(/.(jpg|jpeg|png|apng|gif|webp|tiff|xbm|bmp|ico|ttf|otf|woff|woff2|html|css|js)(\?[0-9]*)?$/i)) {
|
||||
if (url.match(/.(svg|jpg|jpeg|png|apng|gif|webp|tiff|xbm|bmp|ico|ttf|otf|woff|woff2|html|css|js)(\?[0-9]*)?$/i)) {
|
||||
try {
|
||||
// relative resolution (session path)
|
||||
// relative resolution (to session path)
|
||||
var id = urlparser.parse('?' + req.headers.cookie, true).query.client_id,
|
||||
sessionPath = path.dirname(ipc.clients[id].sessionPath)
|
||||
|
||||
res.sendFile(path.resolve(sessionPath + url))
|
||||
} catch(e) {
|
||||
// absolute resolution (session path)
|
||||
// absolute resolution
|
||||
res.sendFile(path.resolve(url))
|
||||
}
|
||||
} else if (url.includes('/osc-ping')) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue