Documentation Source Text

Check-in [13343b49cc]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:In althttpd.c, if the client sends a "Host:" parameter that is a FQDN (with a "dot" at the end - "sqlite.org." instead of "sqlite.org") then omit the final "." when computing the document root. See the bug report on the fossil forum.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 13343b49ccb9c515f935195e3f49e1174c393eb8be7dcc479e51ca6587441c79
User & Date: drh 2020-04-28 13:07:50
Original Comment: In althttpd.c, if the client sends a "Host:" parameter that is a FQDN (with a "dot" at the end - "sqlite.org." instead of "sqlite.org") then omit the final "." when computing the document root.
Context
2020-04-29
04:02
Name another situation where REINDEX is useful, and take the opportunity to link to the indexes-on-expressions page. Note: the inconsistency between saying "indexes" and "indices" is intentional in order to make the page link work right, and I did not dare mess with sentences beginning with "^". (check-in: 769f1fe673 user: andygoth tags: trunk)
2020-04-28
13:07
In althttpd.c, if the client sends a "Host:" parameter that is a FQDN (with a "dot" at the end - "sqlite.org." instead of "sqlite.org") then omit the final "." when computing the document root. See the bug report on the fossil forum. (check-in: 13343b49cc user: drh tags: trunk)
2020-04-23
15:42
Enhancements to quirks.html and lang_createtrigger.html. (check-in: d734b7b070 user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to misc/althttpd.c.

1940
1941
1942
1943
1944
1945
1946






1947
1948
1949
1950
1951
1952
1953
  }else if( strlen(zHttpHost)+strlen(zRoot)+10 >= sizeof(zLine) ){
    NotFound(340);  /* LOG: HOST parameter too long */
  }else{
    sprintf(zLine, "%s/%s", zRoot, zHttpHost);
    for(i=strlen(zRoot)+1; zLine[i] && zLine[i]!=':'; i++){
      unsigned char c = (unsigned char)zLine[i];
      if( !isalnum(c) ){






        zLine[i] = '_';
      }else if( isupper(c) ){
        zLine[i] = tolower(c);
      }
    }
    strcpy(&zLine[i], ".website");
  }







>
>
>
>
>
>







1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
  }else if( strlen(zHttpHost)+strlen(zRoot)+10 >= sizeof(zLine) ){
    NotFound(340);  /* LOG: HOST parameter too long */
  }else{
    sprintf(zLine, "%s/%s", zRoot, zHttpHost);
    for(i=strlen(zRoot)+1; zLine[i] && zLine[i]!=':'; i++){
      unsigned char c = (unsigned char)zLine[i];
      if( !isalnum(c) ){
        if( c=='.' && (zLine[i+1]==0 || zLine[i+1]==':') ){
          /* If the client sent a FQDN with a "." at the end
          ** (example: "sqlite.org." instead of just "sqlite.org") then
          ** omit the final "." from the document root directory name */
          break;
        }
        zLine[i] = '_';
      }else if( isupper(c) ){
        zLine[i] = tolower(c);
      }
    }
    strcpy(&zLine[i], ".website");
  }