Fossil SCM
Added mjs (ES6 modules) mimetype. Changed JS mimetype from application/javascript to text/javascript to conform with the HTML spec. application/javascript is commonly used in the wild.
Commit
a54a2c6ac3d7850b1373ee62fb3a245e79964701dbebe8241052ba6d537b4d7f
Parent
fb9f3dcce6d3353…
4 files changed
+4
-5
+7
-1
+10
-8
+2
-2
+4
-5
| --- src/builtin.c | ||
| +++ src/builtin.c | ||
| @@ -130,20 +130,19 @@ | ||
| 130 | 130 | blob_reset(&x); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /* |
| 134 | 134 | ** Input zList is a list of numeric identifiers for files in |
| 135 | -** aBuiltinFiles[]. Return the concatenation of all of those | |
| 136 | -** files using mimetype zType, or as application/javascript if | |
| 137 | -** zType is 0. | |
| 135 | +** aBuiltinFiles[]. Return the concatenation of all of those files | |
| 136 | +** using mimetype zType, or as text/javascript if zType is 0. | |
| 138 | 137 | */ |
| 139 | 138 | static void builtin_deliver_multiple_js_files( |
| 140 | 139 | const char *zList, /* List of numeric identifiers */ |
| 141 | 140 | const char *zType /* Override mimetype */ |
| 142 | 141 | ){ |
| 143 | 142 | Blob *pOut; |
| 144 | - if( zType==0 ) zType = "application/javascript"; | |
| 143 | + if( zType==0 ) zType = "text/javascript"; | |
| 145 | 144 | cgi_set_content_type(zType); |
| 146 | 145 | pOut = cgi_output_blob(); |
| 147 | 146 | while( zList[0] ){ |
| 148 | 147 | int i = atoi(zList); |
| 149 | 148 | if( i>0 && i<=count(aBuiltinFiles) ){ |
| @@ -203,11 +202,11 @@ | ||
| 203 | 202 | @ File "%h(zName)" not found |
| 204 | 203 | return; |
| 205 | 204 | } |
| 206 | 205 | if( zType==0 ){ |
| 207 | 206 | if( sqlite3_strglob("*.js", zName)==0 ){ |
| 208 | - zType = "application/javascript"; | |
| 207 | + zType = "text/javascript"; | |
| 209 | 208 | }else{ |
| 210 | 209 | zType = mimetype_from_name(zName); |
| 211 | 210 | } |
| 212 | 211 | } |
| 213 | 212 | cgi_set_content_type(zType); |
| 214 | 213 |
| --- src/builtin.c | |
| +++ src/builtin.c | |
| @@ -130,20 +130,19 @@ | |
| 130 | blob_reset(&x); |
| 131 | } |
| 132 | |
| 133 | /* |
| 134 | ** Input zList is a list of numeric identifiers for files in |
| 135 | ** aBuiltinFiles[]. Return the concatenation of all of those |
| 136 | ** files using mimetype zType, or as application/javascript if |
| 137 | ** zType is 0. |
| 138 | */ |
| 139 | static void builtin_deliver_multiple_js_files( |
| 140 | const char *zList, /* List of numeric identifiers */ |
| 141 | const char *zType /* Override mimetype */ |
| 142 | ){ |
| 143 | Blob *pOut; |
| 144 | if( zType==0 ) zType = "application/javascript"; |
| 145 | cgi_set_content_type(zType); |
| 146 | pOut = cgi_output_blob(); |
| 147 | while( zList[0] ){ |
| 148 | int i = atoi(zList); |
| 149 | if( i>0 && i<=count(aBuiltinFiles) ){ |
| @@ -203,11 +202,11 @@ | |
| 203 | @ File "%h(zName)" not found |
| 204 | return; |
| 205 | } |
| 206 | if( zType==0 ){ |
| 207 | if( sqlite3_strglob("*.js", zName)==0 ){ |
| 208 | zType = "application/javascript"; |
| 209 | }else{ |
| 210 | zType = mimetype_from_name(zName); |
| 211 | } |
| 212 | } |
| 213 | cgi_set_content_type(zType); |
| 214 |
| --- src/builtin.c | |
| +++ src/builtin.c | |
| @@ -130,20 +130,19 @@ | |
| 130 | blob_reset(&x); |
| 131 | } |
| 132 | |
| 133 | /* |
| 134 | ** Input zList is a list of numeric identifiers for files in |
| 135 | ** aBuiltinFiles[]. Return the concatenation of all of those files |
| 136 | ** using mimetype zType, or as text/javascript if zType is 0. |
| 137 | */ |
| 138 | static void builtin_deliver_multiple_js_files( |
| 139 | const char *zList, /* List of numeric identifiers */ |
| 140 | const char *zType /* Override mimetype */ |
| 141 | ){ |
| 142 | Blob *pOut; |
| 143 | if( zType==0 ) zType = "text/javascript"; |
| 144 | cgi_set_content_type(zType); |
| 145 | pOut = cgi_output_blob(); |
| 146 | while( zList[0] ){ |
| 147 | int i = atoi(zList); |
| 148 | if( i>0 && i<=count(aBuiltinFiles) ){ |
| @@ -203,11 +202,11 @@ | |
| 202 | @ File "%h(zName)" not found |
| 203 | return; |
| 204 | } |
| 205 | if( zType==0 ){ |
| 206 | if( sqlite3_strglob("*.js", zName)==0 ){ |
| 207 | zType = "text/javascript"; |
| 208 | }else{ |
| 209 | zType = mimetype_from_name(zName); |
| 210 | } |
| 211 | } |
| 212 | cgi_set_content_type(zType); |
| 213 |
+7
-1
| --- src/doc.c | ||
| +++ src/doc.c | ||
| @@ -156,11 +156,16 @@ | ||
| 156 | 156 | { "jad", 3, "text/vnd.sun.j2me.app-descriptor" }, |
| 157 | 157 | { "jar", 3, "application/java-archive" }, |
| 158 | 158 | { "jpe", 3, "image/jpeg" }, |
| 159 | 159 | { "jpeg", 4, "image/jpeg" }, |
| 160 | 160 | { "jpg", 3, "image/jpeg" }, |
| 161 | - { "js", 2, "application/javascript" }, | |
| 161 | + { "js", 2, "text/javascript" }, | |
| 162 | + /* application/javascript is commonly used for JS, but the | |
| 163 | + ** spec says text/javascript is correct: | |
| 164 | + ** https://html.spec.whatwg.org/multipage/scripting.html | |
| 165 | + ** #scriptingLanguages:javascript-mime-type */ | |
| 166 | + { "json", 4, "application/json" }, | |
| 162 | 167 | { "kar", 3, "audio/midi" }, |
| 163 | 168 | { "latex", 5, "application/x-latex" }, |
| 164 | 169 | { "lha", 3, "application/octet-stream" }, |
| 165 | 170 | { "lsp", 3, "application/x-lisp" }, |
| 166 | 171 | { "lzh", 3, "application/octet-stream" }, |
| @@ -173,10 +178,11 @@ | ||
| 173 | 178 | { "mesh", 4, "model/mesh" }, |
| 174 | 179 | { "mid", 3, "audio/midi" }, |
| 175 | 180 | { "midi", 4, "audio/midi" }, |
| 176 | 181 | { "mif", 3, "application/x-mif" }, |
| 177 | 182 | { "mime", 4, "www/mime" }, |
| 183 | + { "mjs", 3, "text/javascript" /*EM6 modules*/ }, | |
| 178 | 184 | { "mkd", 3, "text/x-markdown" }, |
| 179 | 185 | { "mov", 3, "video/quicktime" }, |
| 180 | 186 | { "movie", 5, "video/x-sgi-movie" }, |
| 181 | 187 | { "mp2", 3, "audio/mpeg" }, |
| 182 | 188 | { "mp3", 3, "audio/mpeg" }, |
| 183 | 189 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -156,11 +156,16 @@ | |
| 156 | { "jad", 3, "text/vnd.sun.j2me.app-descriptor" }, |
| 157 | { "jar", 3, "application/java-archive" }, |
| 158 | { "jpe", 3, "image/jpeg" }, |
| 159 | { "jpeg", 4, "image/jpeg" }, |
| 160 | { "jpg", 3, "image/jpeg" }, |
| 161 | { "js", 2, "application/javascript" }, |
| 162 | { "kar", 3, "audio/midi" }, |
| 163 | { "latex", 5, "application/x-latex" }, |
| 164 | { "lha", 3, "application/octet-stream" }, |
| 165 | { "lsp", 3, "application/x-lisp" }, |
| 166 | { "lzh", 3, "application/octet-stream" }, |
| @@ -173,10 +178,11 @@ | |
| 173 | { "mesh", 4, "model/mesh" }, |
| 174 | { "mid", 3, "audio/midi" }, |
| 175 | { "midi", 4, "audio/midi" }, |
| 176 | { "mif", 3, "application/x-mif" }, |
| 177 | { "mime", 4, "www/mime" }, |
| 178 | { "mkd", 3, "text/x-markdown" }, |
| 179 | { "mov", 3, "video/quicktime" }, |
| 180 | { "movie", 5, "video/x-sgi-movie" }, |
| 181 | { "mp2", 3, "audio/mpeg" }, |
| 182 | { "mp3", 3, "audio/mpeg" }, |
| 183 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -156,11 +156,16 @@ | |
| 156 | { "jad", 3, "text/vnd.sun.j2me.app-descriptor" }, |
| 157 | { "jar", 3, "application/java-archive" }, |
| 158 | { "jpe", 3, "image/jpeg" }, |
| 159 | { "jpeg", 4, "image/jpeg" }, |
| 160 | { "jpg", 3, "image/jpeg" }, |
| 161 | { "js", 2, "text/javascript" }, |
| 162 | /* application/javascript is commonly used for JS, but the |
| 163 | ** spec says text/javascript is correct: |
| 164 | ** https://html.spec.whatwg.org/multipage/scripting.html |
| 165 | ** #scriptingLanguages:javascript-mime-type */ |
| 166 | { "json", 4, "application/json" }, |
| 167 | { "kar", 3, "audio/midi" }, |
| 168 | { "latex", 5, "application/x-latex" }, |
| 169 | { "lha", 3, "application/octet-stream" }, |
| 170 | { "lsp", 3, "application/x-lisp" }, |
| 171 | { "lzh", 3, "application/octet-stream" }, |
| @@ -173,10 +178,11 @@ | |
| 178 | { "mesh", 4, "model/mesh" }, |
| 179 | { "mid", 3, "audio/midi" }, |
| 180 | { "midi", 4, "audio/midi" }, |
| 181 | { "mif", 3, "application/x-mif" }, |
| 182 | { "mime", 4, "www/mime" }, |
| 183 | { "mjs", 3, "text/javascript" /*EM6 modules*/ }, |
| 184 | { "mkd", 3, "text/x-markdown" }, |
| 185 | { "mov", 3, "video/quicktime" }, |
| 186 | { "movie", 5, "video/x-sgi-movie" }, |
| 187 | { "mp2", 3, "audio/mpeg" }, |
| 188 | { "mp3", 3, "audio/mpeg" }, |
| 189 |
+10
-8
| --- src/json.c | ||
| +++ src/json.c | ||
| @@ -558,11 +558,11 @@ | ||
| 558 | 558 | /* |
| 559 | 559 | ** Guesses a RESPONSE Content-Type value based (primarily) on the |
| 560 | 560 | ** HTTP_ACCEPT header. |
| 561 | 561 | ** |
| 562 | 562 | ** It will try to figure out if the client can support |
| 563 | -** application/json or application/javascript, and will fall back to | |
| 563 | +** application/json, text/javascript, and will fall back to | |
| 564 | 564 | ** text/plain if it cannot figure out anything more specific. |
| 565 | 565 | ** |
| 566 | 566 | ** Returned memory is static and immutable, but if the environment |
| 567 | 567 | ** changes after calling this then subsequent calls to this function |
| 568 | 568 | ** might return different (also static/immutable) values. |
| @@ -573,12 +573,12 @@ | ||
| 573 | 573 | cset = PD("HTTP_ACCEPT_CHARSET",NULL); |
| 574 | 574 | doUtf8 = ((NULL == cset) || (NULL!=strstr("utf-8",cset))) |
| 575 | 575 | ? 1 : 0; |
| 576 | 576 | if( g.json.jsonp ){ |
| 577 | 577 | return doUtf8 |
| 578 | - ? "application/javascript; charset=utf-8" | |
| 579 | - : "application/javascript"; | |
| 578 | + ? "text/javascript; charset=utf-8" | |
| 579 | + : "text/javascript"; | |
| 580 | 580 | }else{ |
| 581 | 581 | /* |
| 582 | 582 | Content-type |
| 583 | 583 | |
| 584 | 584 | If the browser does not sent an ACCEPT for application/json |
| @@ -605,18 +605,19 @@ | ||
| 605 | 605 | |
| 606 | 606 | /* |
| 607 | 607 | ** Given a request CONTENT_TYPE value, this function returns true |
| 608 | 608 | ** if it is of a type which the JSON API can ostensibly read. |
| 609 | 609 | ** |
| 610 | - ** It accepts any of application/json, text/plain, or | |
| 611 | - ** application/javascript. The former is preferred, but was not | |
| 612 | - ** widespread when this API was initially built, so the latter forms | |
| 613 | - ** are permitted as fallbacks. | |
| 610 | + ** It accepts any of application/json, text/plain, | |
| 611 | + ** application/javascript, or text/javascript. The former is | |
| 612 | + ** preferred, but was not widespread when this API was initially | |
| 613 | + ** built, so the latter forms are permitted as fallbacks. | |
| 614 | 614 | */ |
| 615 | 615 | int json_can_consume_content_type(const char * zType){ |
| 616 | 616 | return fossil_strcmp(zType, "application/json")==0 |
| 617 | 617 | || fossil_strcmp(zType,"text/plain")==0/*assume this MIGHT be JSON*/ |
| 618 | + || fossil_strcmp(zType,"text/javascript")==0 | |
| 618 | 619 | || fossil_strcmp(zType,"application/javascript")==0; |
| 619 | 620 | } |
| 620 | 621 | |
| 621 | 622 | /* |
| 622 | 623 | ** Sends pResponse to the output stream as the response object. This |
| @@ -627,18 +628,19 @@ | ||
| 627 | 628 | ** In CLI mode pResponse is sent to stdout immediately. In HTTP |
| 628 | 629 | ** mode pResponse replaces any current CGI content but cgi_reply() |
| 629 | 630 | ** is not called to flush the output. |
| 630 | 631 | ** |
| 631 | 632 | ** If g.json.jsonp is not NULL then the content type is set to |
| 632 | -** application/javascript and the output is wrapped in a jsonp | |
| 633 | +** text/javascript and the output is wrapped in a jsonp | |
| 633 | 634 | ** wrapper. |
| 634 | 635 | */ |
| 635 | 636 | void json_send_response( cson_value const * pResponse ){ |
| 636 | 637 | assert( NULL != pResponse ); |
| 637 | 638 | if( g.isHTTP ){ |
| 638 | 639 | cgi_reset_content(); |
| 639 | 640 | if( g.json.jsonp ){ |
| 641 | + cgi_set_content_type("text/javascript"); | |
| 640 | 642 | cgi_printf("%s(",g.json.jsonp); |
| 641 | 643 | } |
| 642 | 644 | cson_output( pResponse, cson_data_dest_cgi, NULL, &g.json.outOpt ); |
| 643 | 645 | if( g.json.jsonp ){ |
| 644 | 646 | cgi_append_content(")",1); |
| 645 | 647 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -558,11 +558,11 @@ | |
| 558 | /* |
| 559 | ** Guesses a RESPONSE Content-Type value based (primarily) on the |
| 560 | ** HTTP_ACCEPT header. |
| 561 | ** |
| 562 | ** It will try to figure out if the client can support |
| 563 | ** application/json or application/javascript, and will fall back to |
| 564 | ** text/plain if it cannot figure out anything more specific. |
| 565 | ** |
| 566 | ** Returned memory is static and immutable, but if the environment |
| 567 | ** changes after calling this then subsequent calls to this function |
| 568 | ** might return different (also static/immutable) values. |
| @@ -573,12 +573,12 @@ | |
| 573 | cset = PD("HTTP_ACCEPT_CHARSET",NULL); |
| 574 | doUtf8 = ((NULL == cset) || (NULL!=strstr("utf-8",cset))) |
| 575 | ? 1 : 0; |
| 576 | if( g.json.jsonp ){ |
| 577 | return doUtf8 |
| 578 | ? "application/javascript; charset=utf-8" |
| 579 | : "application/javascript"; |
| 580 | }else{ |
| 581 | /* |
| 582 | Content-type |
| 583 | |
| 584 | If the browser does not sent an ACCEPT for application/json |
| @@ -605,18 +605,19 @@ | |
| 605 | |
| 606 | /* |
| 607 | ** Given a request CONTENT_TYPE value, this function returns true |
| 608 | ** if it is of a type which the JSON API can ostensibly read. |
| 609 | ** |
| 610 | ** It accepts any of application/json, text/plain, or |
| 611 | ** application/javascript. The former is preferred, but was not |
| 612 | ** widespread when this API was initially built, so the latter forms |
| 613 | ** are permitted as fallbacks. |
| 614 | */ |
| 615 | int json_can_consume_content_type(const char * zType){ |
| 616 | return fossil_strcmp(zType, "application/json")==0 |
| 617 | || fossil_strcmp(zType,"text/plain")==0/*assume this MIGHT be JSON*/ |
| 618 | || fossil_strcmp(zType,"application/javascript")==0; |
| 619 | } |
| 620 | |
| 621 | /* |
| 622 | ** Sends pResponse to the output stream as the response object. This |
| @@ -627,18 +628,19 @@ | |
| 627 | ** In CLI mode pResponse is sent to stdout immediately. In HTTP |
| 628 | ** mode pResponse replaces any current CGI content but cgi_reply() |
| 629 | ** is not called to flush the output. |
| 630 | ** |
| 631 | ** If g.json.jsonp is not NULL then the content type is set to |
| 632 | ** application/javascript and the output is wrapped in a jsonp |
| 633 | ** wrapper. |
| 634 | */ |
| 635 | void json_send_response( cson_value const * pResponse ){ |
| 636 | assert( NULL != pResponse ); |
| 637 | if( g.isHTTP ){ |
| 638 | cgi_reset_content(); |
| 639 | if( g.json.jsonp ){ |
| 640 | cgi_printf("%s(",g.json.jsonp); |
| 641 | } |
| 642 | cson_output( pResponse, cson_data_dest_cgi, NULL, &g.json.outOpt ); |
| 643 | if( g.json.jsonp ){ |
| 644 | cgi_append_content(")",1); |
| 645 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -558,11 +558,11 @@ | |
| 558 | /* |
| 559 | ** Guesses a RESPONSE Content-Type value based (primarily) on the |
| 560 | ** HTTP_ACCEPT header. |
| 561 | ** |
| 562 | ** It will try to figure out if the client can support |
| 563 | ** application/json, text/javascript, and will fall back to |
| 564 | ** text/plain if it cannot figure out anything more specific. |
| 565 | ** |
| 566 | ** Returned memory is static and immutable, but if the environment |
| 567 | ** changes after calling this then subsequent calls to this function |
| 568 | ** might return different (also static/immutable) values. |
| @@ -573,12 +573,12 @@ | |
| 573 | cset = PD("HTTP_ACCEPT_CHARSET",NULL); |
| 574 | doUtf8 = ((NULL == cset) || (NULL!=strstr("utf-8",cset))) |
| 575 | ? 1 : 0; |
| 576 | if( g.json.jsonp ){ |
| 577 | return doUtf8 |
| 578 | ? "text/javascript; charset=utf-8" |
| 579 | : "text/javascript"; |
| 580 | }else{ |
| 581 | /* |
| 582 | Content-type |
| 583 | |
| 584 | If the browser does not sent an ACCEPT for application/json |
| @@ -605,18 +605,19 @@ | |
| 605 | |
| 606 | /* |
| 607 | ** Given a request CONTENT_TYPE value, this function returns true |
| 608 | ** if it is of a type which the JSON API can ostensibly read. |
| 609 | ** |
| 610 | ** It accepts any of application/json, text/plain, |
| 611 | ** application/javascript, or text/javascript. The former is |
| 612 | ** preferred, but was not widespread when this API was initially |
| 613 | ** built, so the latter forms are permitted as fallbacks. |
| 614 | */ |
| 615 | int json_can_consume_content_type(const char * zType){ |
| 616 | return fossil_strcmp(zType, "application/json")==0 |
| 617 | || fossil_strcmp(zType,"text/plain")==0/*assume this MIGHT be JSON*/ |
| 618 | || fossil_strcmp(zType,"text/javascript")==0 |
| 619 | || fossil_strcmp(zType,"application/javascript")==0; |
| 620 | } |
| 621 | |
| 622 | /* |
| 623 | ** Sends pResponse to the output stream as the response object. This |
| @@ -627,18 +628,19 @@ | |
| 628 | ** In CLI mode pResponse is sent to stdout immediately. In HTTP |
| 629 | ** mode pResponse replaces any current CGI content but cgi_reply() |
| 630 | ** is not called to flush the output. |
| 631 | ** |
| 632 | ** If g.json.jsonp is not NULL then the content type is set to |
| 633 | ** text/javascript and the output is wrapped in a jsonp |
| 634 | ** wrapper. |
| 635 | */ |
| 636 | void json_send_response( cson_value const * pResponse ){ |
| 637 | assert( NULL != pResponse ); |
| 638 | if( g.isHTTP ){ |
| 639 | cgi_reset_content(); |
| 640 | if( g.json.jsonp ){ |
| 641 | cgi_set_content_type("text/javascript"); |
| 642 | cgi_printf("%s(",g.json.jsonp); |
| 643 | } |
| 644 | cson_output( pResponse, cson_data_dest_cgi, NULL, &g.json.outOpt ); |
| 645 | if( g.json.jsonp ){ |
| 646 | cgi_append_content(")",1); |
| 647 |
+2
-2
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -901,11 +901,11 @@ | ||
| 901 | 901 | static void style_load_all_js_files(void){ |
| 902 | 902 | if( needHrefJs && g.perm.Hyperlink ){ |
| 903 | 903 | int nDelay = db_get_int("auto-hyperlink-delay",0); |
| 904 | 904 | int bMouseover = db_get_boolean("auto-hyperlink-mouseover",0) |
| 905 | 905 | && sqlite3_strglob("*Android*",PD("HTTP_USER_AGENT","")); |
| 906 | - @ <script id='href-data' type='application/json'>\ | |
| 906 | + @ <script id='href-data' type='text/json'>\ | |
| 907 | 907 | @ {"delay":%d(nDelay),"mouseover":%d(bMouseover)}</script> |
| 908 | 908 | } |
| 909 | 909 | @ <script nonce="%h(style_nonce())">/* style.c:%d(__LINE__) */ |
| 910 | 910 | @ function debugMsg(msg){ |
| 911 | 911 | @ var n = document.getElementById("debugMsg"); |
| @@ -1220,11 +1220,11 @@ | ||
| 1220 | 1220 | /* Render the script as plain-text for testing purposes, if the "test" |
| 1221 | 1221 | ** query parameter is present */ |
| 1222 | 1222 | cgi_set_content_type("text/plain"); |
| 1223 | 1223 | }else{ |
| 1224 | 1224 | /* Default behavior is to return javascript */ |
| 1225 | - cgi_set_content_type("application/javascript"); | |
| 1225 | + cgi_set_content_type("text/javascript"); | |
| 1226 | 1226 | } |
| 1227 | 1227 | style_init_th1_vars(0); |
| 1228 | 1228 | Th_Render(zScript?zScript:""); |
| 1229 | 1229 | } |
| 1230 | 1230 | |
| 1231 | 1231 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -901,11 +901,11 @@ | |
| 901 | static void style_load_all_js_files(void){ |
| 902 | if( needHrefJs && g.perm.Hyperlink ){ |
| 903 | int nDelay = db_get_int("auto-hyperlink-delay",0); |
| 904 | int bMouseover = db_get_boolean("auto-hyperlink-mouseover",0) |
| 905 | && sqlite3_strglob("*Android*",PD("HTTP_USER_AGENT","")); |
| 906 | @ <script id='href-data' type='application/json'>\ |
| 907 | @ {"delay":%d(nDelay),"mouseover":%d(bMouseover)}</script> |
| 908 | } |
| 909 | @ <script nonce="%h(style_nonce())">/* style.c:%d(__LINE__) */ |
| 910 | @ function debugMsg(msg){ |
| 911 | @ var n = document.getElementById("debugMsg"); |
| @@ -1220,11 +1220,11 @@ | |
| 1220 | /* Render the script as plain-text for testing purposes, if the "test" |
| 1221 | ** query parameter is present */ |
| 1222 | cgi_set_content_type("text/plain"); |
| 1223 | }else{ |
| 1224 | /* Default behavior is to return javascript */ |
| 1225 | cgi_set_content_type("application/javascript"); |
| 1226 | } |
| 1227 | style_init_th1_vars(0); |
| 1228 | Th_Render(zScript?zScript:""); |
| 1229 | } |
| 1230 | |
| 1231 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -901,11 +901,11 @@ | |
| 901 | static void style_load_all_js_files(void){ |
| 902 | if( needHrefJs && g.perm.Hyperlink ){ |
| 903 | int nDelay = db_get_int("auto-hyperlink-delay",0); |
| 904 | int bMouseover = db_get_boolean("auto-hyperlink-mouseover",0) |
| 905 | && sqlite3_strglob("*Android*",PD("HTTP_USER_AGENT","")); |
| 906 | @ <script id='href-data' type='text/json'>\ |
| 907 | @ {"delay":%d(nDelay),"mouseover":%d(bMouseover)}</script> |
| 908 | } |
| 909 | @ <script nonce="%h(style_nonce())">/* style.c:%d(__LINE__) */ |
| 910 | @ function debugMsg(msg){ |
| 911 | @ var n = document.getElementById("debugMsg"); |
| @@ -1220,11 +1220,11 @@ | |
| 1220 | /* Render the script as plain-text for testing purposes, if the "test" |
| 1221 | ** query parameter is present */ |
| 1222 | cgi_set_content_type("text/plain"); |
| 1223 | }else{ |
| 1224 | /* Default behavior is to return javascript */ |
| 1225 | cgi_set_content_type("text/javascript"); |
| 1226 | } |
| 1227 | style_init_th1_vars(0); |
| 1228 | Th_Render(zScript?zScript:""); |
| 1229 | } |
| 1230 | |
| 1231 |