Fossil SCM
Use application/json instead of text/json for JSON-format responses. [forum:30629128c1|Forum post 30629128c1].
Commit
c0714a05ec1a52c29487f1873617e118d42976fb011524e7aefcd330218f4d59
Parent
49e3bf7b1324afa…
2 files changed
+1
-1
+1
-1
+1
-1
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -1948,11 +1948,11 @@ | ||
| 1948 | 1948 | iFrom, iTo); |
| 1949 | 1949 | return; |
| 1950 | 1950 | } |
| 1951 | 1951 | content_get(rid, &content); |
| 1952 | 1952 | g.isConst = 1; |
| 1953 | - cgi_set_content_type("text/json"); | |
| 1953 | + cgi_set_content_type("application/json"); | |
| 1954 | 1954 | ln = 0; |
| 1955 | 1955 | while( go && ln<iFrom ){ |
| 1956 | 1956 | go = blob_line(&content, &line); |
| 1957 | 1957 | ln++; |
| 1958 | 1958 | } |
| 1959 | 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("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 |
+1
-1
| --- src/unversioned.c | ||
| +++ src/unversioned.c | ||
| @@ -657,11 +657,11 @@ | ||
| 657 | 657 | char *zSep = "["; |
| 658 | 658 | Blob json; |
| 659 | 659 | |
| 660 | 660 | login_check_credentials(); |
| 661 | 661 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 662 | - cgi_set_content_type("text/json"); | |
| 662 | + cgi_set_content_type("application/json"); | |
| 663 | 663 | etag_check(ETAG_DATA,0); |
| 664 | 664 | if( !db_table_exists("repository","unversioned") ){ |
| 665 | 665 | blob_init(&json, "[]", -1); |
| 666 | 666 | cgi_set_content(&json); |
| 667 | 667 | return; |
| 668 | 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("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 |