Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 521481 - If no contextPath is set, making /users request causes s…
…erver to throw exception
  • Loading branch information
mrennie committed Aug 28, 2017
1 parent ea52eae commit 9a1cf6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/orionode/lib/user.js
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016 IBM Corporation and others.
* Copyright (c) 2016, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the Eclipse Public License v1.0
* (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
Expand Down Expand Up @@ -265,7 +265,7 @@ module.exports.router = function(options) {
if (!req.user || !(req.params.id === req.user.username || isAdmin(req.user.username))) {
return api.writeResponse(403, res);
}
var uri = req.originalUrl.substring(req.baseUrl.length + req.contextPath.length);
var uri = req.originalUrl.substring(req.baseUrl.length + (typeof req.contextPath === 'string' ? req.contextPath.length : 0));
req.user.checkRights(req.user.username, uri, req, res, next);
}

Expand Down

0 comments on commit 9a1cf6d

Please sign in to comment.