From 0eab5e58028f4a9044af6a06c06985a37b243248 Mon Sep 17 00:00:00 2001
From: Aaron Weaver <aaronweaver@users.noreply.github.com>
Date: Tue, 14 Aug 2018 15:39:40 -0400
Subject: [PATCH] Revert "Add support for custom DefectDojo URL prefix"

---
 defectdojo_api/defectdojo.py | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/defectdojo_api/defectdojo.py b/defectdojo_api/defectdojo.py
index 8442f87..5c7eba9 100644
--- a/defectdojo_api/defectdojo.py
+++ b/defectdojo_api/defectdojo.py
@@ -33,11 +33,6 @@ class DefectDojoAPI(object):
         self.verify_ssl = verify_ssl
         self.proxies = proxies
         self.timeout = timeout
-        
-        if host.split('/') > 3:
-            self.custom_path = '/' + '/'.join(host.split('/')[3:]).rstrip('/')
-        else:
-            self.custom_path = ''
 
         if not user_agent:
             self.user_agent = 'DefectDojo_api/' + version
@@ -51,7 +46,6 @@ class DefectDojoAPI(object):
             requests.packages.urllib3.disable_warnings()  # Disabling SSL warning messages if verification is disabled.
 
     ###### Helper Functions ######
-
     def get_user_uri(self, user_id):
         """Returns the DefectDojo API URI for a user.
 
@@ -59,7 +53,7 @@ class DefectDojoAPI(object):
 
         """
 
-        return self.custom_path + "/api/" + self.api_version + "/users/" + str(user_id) + "/"
+        return "/api/" + self.api_version + "/users/" + str(user_id) + "/"
 
     def get_engagement_uri(self, engagement_id):
         """Returns the DefectDojo API URI for an engagement.
@@ -67,7 +61,7 @@ class DefectDojoAPI(object):
         :param engagement_id: Id of the engagement
 
         """
-        return self.custom_path + "/api/" + self.api_version + "/engagements/" + str(engagement_id) + "/"
+        return "/api/" + self.api_version + "/engagements/" + str(engagement_id) + "/"
 
     def get_product_uri(self, product_id):
         """Returns the DefectDojo API URI for a product.
@@ -75,7 +69,7 @@ class DefectDojoAPI(object):
         :param product_id: Id of the product
 
         """
-        return self.custom_path + "/api/" + self.api_version + "/products/" + str(product_id) + "/"
+        return "/api/" + self.api_version + "/products/" + str(product_id) + "/"
 
     def get_test_uri(self, test_id):
         """Returns the DefectDojo API URI for a test.
@@ -83,7 +77,7 @@ class DefectDojoAPI(object):
         :param test_id: Id of the test
 
         """
-        return self.custom_path + "/api/" + self.api_version + "/tests/" + str(test_id) + "/"
+        return "/api/" + self.api_version + "/tests/" + str(test_id) + "/"
 
     def get_language_uri(self, language_type_id):
         """Returns the DefectDojo API URI for a langauge.
@@ -91,7 +85,7 @@ class DefectDojoAPI(object):
         :param test_id: Id of the language
 
         """
-        return self.custom_path + "/api/" + self.api_version + "/language_types/" + str(language_type_id) + "/"
+        return "/api/" + self.api_version + "/language_types/" + str(language_type_id) + "/"
 
     def get_tool_configuration_uri(self, tool_configuration_id):
         """Returns the DefectDojo API URI for a tool.
-- 
GitLab