Fossil

Check-in [c0714a05ec]
Login

Check-in [c0714a05ec]

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

Overview
Comment:Use application/json instead of text/json for JSON-format responses. [forum:30629128c1|Forum post 30629128c1].
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c0714a05ec1a52c29487f1873617e118d42976fb011524e7aefcd330218f4d59
User & Date: stephan 2021-10-08 17:49:27.051
Context
2021-10-08
17:53
sync.wiki: update the default value for the lock timeout period, [forum:242a02121f|per forum post 242a02121f]. ... (check-in: 62572ab606 user: stephan tags: trunk)
17:49
Use application/json instead of text/json for JSON-format responses. [forum:30629128c1|Forum post 30629128c1]. ... (check-in: c0714a05ec user: stephan tags: trunk)
17:42
Documented fossil.fetch()'s behavior of onerror() being called if onload() throws. Added a safety net in the diff context loader to handle a corner case null dereference when an exception in onload() triggers onerror() after the context loader's DOM elements have been destroyed. [forum:7bc8301eb191cf6d|Forum post 7bc8301eb191cf6d]. ... (check-in: 49e3bf7b13 user: stephan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/info.c.
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
  if( iFrom<1 || iTo<iFrom ){
    ajax_route_error(500, "Invalid line range from=%d, to=%d.",
                     iFrom, iTo);
    return;
  }
  content_get(rid, &content);
  g.isConst = 1;
  cgi_set_content_type("text/json");
  ln = 0;
  while( go && ln<iFrom ){
    go = blob_line(&content, &line);
    ln++;
  }
  pOut = cgi_output_blob();
  blob_append(pOut, "[\n", 2);







|







1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
  if( iFrom<1 || iTo<iFrom ){
    ajax_route_error(500, "Invalid line range from=%d, to=%d.",
                     iFrom, iTo);
    return;
  }
  content_get(rid, &content);
  g.isConst = 1;
  cgi_set_content_type("application/json");
  ln = 0;
  while( go && ln<iFrom ){
    go = blob_line(&content, &line);
    ln++;
  }
  pOut = cgi_output_blob();
  blob_append(pOut, "[\n", 2);
Changes to src/unversioned.c.
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
void uvlist_json_page(void){
  Stmt q;
  char *zSep = "[";
  Blob json;

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
  cgi_set_content_type("text/json");
  etag_check(ETAG_DATA,0);
  if( !db_table_exists("repository","unversioned") ){
    blob_init(&json, "[]", -1);
    cgi_set_content(&json);
    return;
  }
  blob_init(&json, 0, 0);







|







655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
void uvlist_json_page(void){
  Stmt q;
  char *zSep = "[";
  Blob json;

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
  cgi_set_content_type("application/json");
  etag_check(ETAG_DATA,0);
  if( !db_table_exists("repository","unversioned") ){
    blob_init(&json, "[]", -1);
    cgi_set_content(&json);
    return;
  }
  blob_init(&json, 0, 0);