Login
Diff
Login

Differences From Artifact [a5f1548cbb]:

To Artifact [e677ff8252]:


1
2
3
4
5
6












7






8
9
10
11
12
13
14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

19
20
21
22
23
24
25
26
27
28
29
30
31






+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+







assert api.cgi

catch { /* Set up some extra CGI environment... */
    const CGI = api.cgi
    const R = CGI.request;
    const uri = R.ENV.REQUEST_URI
    if(uri){
      /* Some hackery/normalizing of the root path for creating links... */
      const indexPageName = 'index.cgi' // kludge!
      const lastChar = uri.charAt(uri.length()-1)
      if(uri.indexOf('.cgi') < 0){
        if('/' === lastChar ){
          CGI.cgiRoot = uri + indexPageName + '/'
        }else{
          CGI.cgiRoot = uri // ???
        }
      }else{
        if('/' !== lastChar ){
    uri && (CGI.cgiRoot = uri.split('.cgi').0+'.cgi/')
          CGI.cgiRoot = uri.split('.cgi').0+'.cgi/')
        }else{
          CGI.cgiRoot = uri
        }
      }
    }
    const serverName = R.ENV.SERVER_NAME
    CGI.isLocalServer = ((!serverName) || (0<=serverName.indexOf(".local")))

    if(R.ENV.PATH_INFO && CGI.cgiRoot){
        CGI.pageLinkRoot =  CGI.cgiRoot + R.ENV.PATH_INFO.substr(1/*trim leading slash*/)
    }else{
        CGI.pageLinkRoot = CGI.cgiRoot