diff --git a/structurizr-client/src/main/java/com/structurizr/api/WorkspaceApiClient.java b/structurizr-client/src/main/java/com/structurizr/api/WorkspaceApiClient.java index 1ab4a715..3b7ce5c9 100644 --- a/structurizr-client/src/main/java/com/structurizr/api/WorkspaceApiClient.java +++ b/structurizr-client/src/main/java/com/structurizr/api/WorkspaceApiClient.java @@ -39,6 +39,7 @@ public class WorkspaceApiClient extends AbstractApiClient { private static final Log log = LogFactory.getLog(WorkspaceApiClient.class); + private static final String MAIN_BRANCH = "main"; private String user; @@ -234,7 +235,7 @@ public Workspace getWorkspace(long workspaceId) throws StructurizrClientExceptio log.info("Getting workspace with ID " + workspaceId); HttpGet httpGet; - if (StringUtils.isNullOrEmpty(branch)) { + if (StringUtils.isNullOrEmpty(branch) || branch.equalsIgnoreCase(MAIN_BRANCH)) { httpGet = new HttpGet(url + WORKSPACE_PATH + "/" + workspaceId); } else { httpGet = new HttpGet(url + WORKSPACE_PATH + "/" + workspaceId + "/branch/" + branch);