Fossil SCM

Use application/json instead of text/json for JSON-format responses. [forum:30629128c1|Forum post 30629128c1].

stephan 2021-10-08 17:49 trunk
Commit c0714a05ec1a52c29487f1873617e118d42976fb011524e7aefcd330218f4d59
2 files changed +1 -1 +1 -1
+1 -1
--- src/info.c
+++ src/info.c
@@ -1948,11 +1948,11 @@
19481948
iFrom, iTo);
19491949
return;
19501950
}
19511951
content_get(rid, &content);
19521952
g.isConst = 1;
1953
- cgi_set_content_type("text/json");
1953
+ cgi_set_content_type("application/json");
19541954
ln = 0;
19551955
while( go && ln<iFrom ){
19561956
go = blob_line(&content, &line);
19571957
ln++;
19581958
}
19591959
--- src/info.c
+++ src/info.c
@@ -1948,11 +1948,11 @@
1948 iFrom, iTo);
1949 return;
1950 }
1951 content_get(rid, &content);
1952 g.isConst = 1;
1953 cgi_set_content_type("text/json");
1954 ln = 0;
1955 while( go && ln<iFrom ){
1956 go = blob_line(&content, &line);
1957 ln++;
1958 }
1959
--- src/info.c
+++ src/info.c
@@ -1948,11 +1948,11 @@
1948 iFrom, iTo);
1949 return;
1950 }
1951 content_get(rid, &content);
1952 g.isConst = 1;
1953 cgi_set_content_type("application/json");
1954 ln = 0;
1955 while( go && ln<iFrom ){
1956 go = blob_line(&content, &line);
1957 ln++;
1958 }
1959
--- src/unversioned.c
+++ src/unversioned.c
@@ -657,11 +657,11 @@
657657
char *zSep = "[";
658658
Blob json;
659659
660660
login_check_credentials();
661661
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
662
- cgi_set_content_type("text/json");
662
+ cgi_set_content_type("application/json");
663663
etag_check(ETAG_DATA,0);
664664
if( !db_table_exists("repository","unversioned") ){
665665
blob_init(&json, "[]", -1);
666666
cgi_set_content(&json);
667667
return;
668668
--- src/unversioned.c
+++ src/unversioned.c
@@ -657,11 +657,11 @@
657 char *zSep = "[";
658 Blob json;
659
660 login_check_credentials();
661 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
662 cgi_set_content_type("text/json");
663 etag_check(ETAG_DATA,0);
664 if( !db_table_exists("repository","unversioned") ){
665 blob_init(&json, "[]", -1);
666 cgi_set_content(&json);
667 return;
668
--- src/unversioned.c
+++ src/unversioned.c
@@ -657,11 +657,11 @@
657 char *zSep = "[";
658 Blob json;
659
660 login_check_credentials();
661 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
662 cgi_set_content_type("application/json");
663 etag_check(ETAG_DATA,0);
664 if( !db_table_exists("repository","unversioned") ){
665 blob_init(&json, "[]", -1);
666 cgi_set_content(&json);
667 return;
668

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button