code: protected static String adjustMappedUrl(SlingHttpServletRequest request, String url) {
          // build a pattern with the (false) default port
          Pattern defaultPortPattern = Pattern.compile(
                  URL_PATTERN_STRING.replaceFirst("\\(:\\\\d\\+\\)\\?", ":" + getDefaultPort(request)));
          Matcher matcher = defaultPortPattern.matcher(url);
          // remove the port if the URL matches (contains the port nnumber)
          if (matcher.matches()) {
              if (null == matcher.group(1)) url = "//" + matcher.group(2);
              else url = matcher.group(1) + "://" + matcher.group(2);
              String uri = matcher.group(3);
              if (StringUtils.isNotBlank(uri)) {
                  url += uri;
              } else {
                  url += "/";
              }
          }
          return url;
      }
docs: in the case of a forwarded SSL request the resource resolver mapping rules must contain the
  false port (80) to ensure a proper resolving - but in the result this bad port is included in the
  mapped URL and must be removed - done here