Changeset 584 for trunk/zoo-project


Ignore:
Timestamp:
Feb 13, 2015, 1:29:03 PM (7 years ago)
Author:
knut
Message:

Added code required for HTTPS requests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/zoo_service_loader.c

    r583 r584  
    969969    setMapInMaps (m, "main", "isSoap", "false");
    970970
    971   if (strlen (cgiServerName) > 0)
    972     {
    973       char tmpUrl[1024];
    974       if (strncmp (cgiServerPort, "80", 2) == 0)
    975         {
    976           sprintf (tmpUrl, "http://%s%s", cgiServerName, cgiScriptName);
    977         }
    978       else
    979         {
    980           sprintf (tmpUrl, "http://%s:%s%s", cgiServerName, cgiServerPort,
    981                    cgiScriptName);
    982         }
    983 #ifdef DEBUG
    984       fprintf (stderr, "*** %s ***\n", tmpUrl);
    985 #endif
    986       setMapInMaps (m, "main", "serverAddress", tmpUrl);
    987     }
     971  if(strlen(cgiServerName)>0)
     972  {
     973    char tmpUrl[1024];
     974       
     975        if ( getenv("HTTPS") != NULL && strncmp(getenv("HTTPS"), "on", 2) == 0 ) { // Knut: check if non-empty instead of "on"?         
     976                if ( strncmp(cgiServerPort, "443", 3) == 0 ) {
     977                        sprintf(tmpUrl, "https://%s%s", cgiServerName, cgiScriptName);
     978                }
     979                else {
     980                        sprintf(tmpUrl, "https://%s:%s%s", cgiServerName, cgiServerPort, cgiScriptName);
     981                }
     982        }
     983        else {
     984                if ( strncmp(cgiServerPort, "80", 2) == 0 ) {
     985                        sprintf(tmpUrl, "http://%s%s", cgiServerName, cgiScriptName);
     986                }
     987                else {
     988                        sprintf(tmpUrl, "http://%s:%s%s", cgiServerName, cgiServerPort, cgiScriptName);
     989                }
     990        }
     991#ifdef DEBUG
     992    fprintf(stderr,"*** %s ***\n",tmpUrl);
     993#endif
     994    setMapInMaps(m,"main","serverAddress",tmpUrl);
     995  }
    988996
    989997  /**
     
    10891097      int saved_stdout = dup (fileno (stdout));
    10901098      dup2 (fileno (stderr), fileno (stdout));
    1091       if (int res =
     1099      if (int res =               
    10921100          recursReaddirF (m, n, conf_dir, NULL, saved_stdout, 0,
    10931101                          printGetCapabilitiesForProcess) < 0)
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png