increase file id to 8 bytes
This commit is contained in:
parent
eced5be836
commit
8cf3b89f91
|
@ -11,7 +11,7 @@ const filelist = require('./filelist');
|
||||||
const clientConstants = require('../clientConstants');
|
const clientConstants = require('../clientConstants');
|
||||||
|
|
||||||
const IS_DEV = config.env === 'development';
|
const IS_DEV = config.env === 'development';
|
||||||
const ID_REGEX = '([0-9a-fA-F]{10})';
|
const ID_REGEX = '([0-9a-fA-F]{10,16})';
|
||||||
|
|
||||||
module.exports = function(app) {
|
module.exports = function(app) {
|
||||||
app.set('trust proxy', true);
|
app.set('trust proxy', true);
|
||||||
|
|
|
@ -8,7 +8,7 @@ const { encryptedSize } = require('../../app/utils');
|
||||||
const log = mozlog('send.upload');
|
const log = mozlog('send.upload');
|
||||||
|
|
||||||
module.exports = async function(req, res) {
|
module.exports = async function(req, res) {
|
||||||
const newId = crypto.randomBytes(5).toString('hex');
|
const newId = crypto.randomBytes(8).toString('hex');
|
||||||
const metadata = req.header('X-File-Metadata');
|
const metadata = req.header('X-File-Metadata');
|
||||||
const auth = req.header('Authorization');
|
const auth = req.header('Authorization');
|
||||||
if (!metadata || !auth) {
|
if (!metadata || !auth) {
|
||||||
|
|
|
@ -23,7 +23,7 @@ module.exports = function(ws, req) {
|
||||||
|
|
||||||
ws.once('message', async function(message) {
|
ws.once('message', async function(message) {
|
||||||
try {
|
try {
|
||||||
const newId = crypto.randomBytes(5).toString('hex');
|
const newId = crypto.randomBytes(8).toString('hex');
|
||||||
const owner = crypto.randomBytes(10).toString('hex');
|
const owner = crypto.randomBytes(10).toString('hex');
|
||||||
|
|
||||||
const fileInfo = JSON.parse(message);
|
const fileInfo = JSON.parse(message);
|
||||||
|
|
Loading…
Reference in New Issue