From 0bb4d5593e4736ecb2c2dd4162a8feeaa2ef6f38 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Tue, 19 Oct 2010 13:46:45 -0400 Subject: [PATCH] fix positon of port number when generating interface url --- sfa/server/interface.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sfa/server/interface.py b/sfa/server/interface.py index 0804fc1d..e923057f 100644 --- a/sfa/server/interface.py +++ b/sfa/server/interface.py @@ -60,8 +60,12 @@ class Interfaces(dict): interfaces = [self.interfaces] # set the url and urn for interface in interfaces: + # port is appended onto the domain, before the path. Should look like: + # http://domain:port/path hrn, address, port = interface['hrn'], interface['addr'], interface['port'] - url = 'http://%(address)s:%(port)s' % locals() + address_parts = address.split('/') + address_parts[0] = address_parts[0] + ":" + str(port) + url = "http://%s" % "/".join(address_parts) interface['url'] = url interface['urn'] = hrn_to_urn(hrn, 'authority') -- 2.43.0