blob: 5e858b88f0336ee355e9eb131a27832764a243b5 [file] [log] [blame]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
module.exports = {
getOrigin: getOrigin
};
// Parse a url and return the origin.
function getOrigin(url) {
var URL = require('url');
var parsed = URL.parse(url);
return parsed.protocol + '//' + parsed.host;
}