Skip to content

Commit 529f7a6

Browse files
committed
Store Shapes with Base64 Names
1 parent af4b9ef commit 529f7a6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

server/db/create-shapes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class createShapes {
5656
if (!fs.existsSync(dir)){
5757
fs.mkdirSync(dir)
5858
}
59-
fs.writeFileSync(path.resolve(dir, `${key}.json`), JSON.stringify(output[key]))
59+
fs.writeFileSync(path.resolve(dir, `${new Buffer(key).toString('base64')}.json`), JSON.stringify(output[key]))
6060
})
6161
console.log('Written to disk!')
6262
resolve()

server/lines/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ var line = {
199199
let prefix = req.params.prefix
200200
const containerName = encodeURIComponent((prefix+'-'+cache.currentVersion(prefix)).replace('_','-').replace('.','-'))
201201
const shape_id = req.params.shape_id
202-
const fileName = encodeURIComponent(shape_id+'.json')
202+
const fileName = encodeURIComponent(new Buffer(shape_id).toString('base64') + '.json')
203203
blobSvc.getBlobToStream(containerName, fileName, res, function(blobError) {
204204
if (blobError) {
205205
res.status(404)

0 commit comments

Comments
 (0)