Skip to content

Commit

Permalink
Merge pull request #11 from secretin/metadata_cache
Browse files Browse the repository at this point in the history
Accept big payload for metadata_cache
  • Loading branch information
agix authored Nov 6, 2017
2 parents f12065c + c1d5c8e commit bb81b53
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const app = express();
app.server = http.createServer(app);

app.use(cors());
app.use(bodyParser.json());
app.use(bodyParser.json({limit: '100mb'}));

initializeDb(config, (couchdb, redis) => {
if (process.env.TEST_SERVER) {
Expand Down
1 change: 1 addition & 0 deletions src/routes/GetUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export default ({ redis, couchdb }) => {
}

delete submitUser.options;
delete submitUser.metadataCache;
delete submitUser.keys;
delete submitUser.seed;
delete submitUser.rescueCodes;
Expand Down
6 changes: 5 additions & 1 deletion src/routes/UpdateUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ export default ({ couchdb, redis }) => {
typeof jsonBody.pass === 'undefined' ||
typeof jsonBody.privateKey === 'undefined'
) {
doc.user[req.params.name].options = jsonBody;
if (typeof jsonBody.options === 'undefined') {
doc.user[req.params.name].metadataCache = jsonBody;
} else {
doc.user[req.params.name].options = jsonBody;
}
} else {
const md = forge.md.sha256.create();
md.update(jsonBody.pass.hash);
Expand Down

0 comments on commit bb81b53

Please sign in to comment.