Lifted restrictions on accepted MIME type.
The "normal" web is moving forward quickly reducing the interoperability of the Contiki web browser to nearly zero. The Mobile Web fits the capabilities of the Contiki web browser much better. Modern smartphones don't need the Mobile Web anymore but there are large areas in world with rather low end mobile phones and limited mobile bandwidth where the Mobile Web will be necessary for quite some time. From that perspective it is reasonable to increase the Contiki web browser's interoperability with the Mobie Web - namely WAP 2.0 aka XHTML MP. XHTML MP is delivered as MIME types 'application/vnd.wap.xhtml+xml' or 'application/xhtml+xml'. Therefore we (try to) parse the document if the MIME type contains the substring 'html' (which is true 'text/html' too).
This commit is contained in:
parent
15fb63ba9a
commit
4938877dd9
|
@ -6,9 +6,8 @@ http_get "GET "
|
||||||
http_10 "HTTP/1.0"
|
http_10 "HTTP/1.0"
|
||||||
http_11 "HTTP/1.1"
|
http_11 "HTTP/1.1"
|
||||||
http_content_type "content-type: "
|
http_content_type "content-type: "
|
||||||
http_texthtml "text/html"
|
|
||||||
http_location "location: "
|
http_location "location: "
|
||||||
http_host "host: "
|
http_host "Host: "
|
||||||
http_crnl "\r\n"
|
http_crnl "\r\n"
|
||||||
http_index_html "/index.html"
|
http_index_html "/index.html"
|
||||||
http_404_html "/404.html"
|
http_404_html "/404.html"
|
||||||
|
|
|
@ -22,15 +22,12 @@ const char http_11[9] =
|
||||||
const char http_content_type[15] =
|
const char http_content_type[15] =
|
||||||
/* "content-type: " */
|
/* "content-type: " */
|
||||||
{0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, };
|
{0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, };
|
||||||
const char http_texthtml[10] =
|
|
||||||
/* "text/html" */
|
|
||||||
{0x74, 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, };
|
|
||||||
const char http_location[11] =
|
const char http_location[11] =
|
||||||
/* "location: " */
|
/* "location: " */
|
||||||
{0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, };
|
{0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, };
|
||||||
const char http_host[7] =
|
const char http_host[7] =
|
||||||
/* "host: " */
|
/* "Host: " */
|
||||||
{0x68, 0x6f, 0x73, 0x74, 0x3a, 0x20, };
|
{0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20, };
|
||||||
const char http_crnl[3] =
|
const char http_crnl[3] =
|
||||||
/* "\r\n" */
|
/* "\r\n" */
|
||||||
{0xd, 0xa, };
|
{0xd, 0xa, };
|
||||||
|
|
|
@ -6,7 +6,6 @@ extern const char http_get[5];
|
||||||
extern const char http_10[9];
|
extern const char http_10[9];
|
||||||
extern const char http_11[9];
|
extern const char http_11[9];
|
||||||
extern const char http_content_type[15];
|
extern const char http_content_type[15];
|
||||||
extern const char http_texthtml[10];
|
|
||||||
extern const char http_location[11];
|
extern const char http_location[11];
|
||||||
extern const char http_host[7];
|
extern const char http_host[7];
|
||||||
extern const char http_crnl[3];
|
extern const char http_crnl[3];
|
||||||
|
|
|
@ -638,7 +638,7 @@ void
|
||||||
webclient_datahandler(char *data, uint16_t len)
|
webclient_datahandler(char *data, uint16_t len)
|
||||||
{
|
{
|
||||||
if(len > 0) {
|
if(len > 0) {
|
||||||
if(strcmp(webclient_mimetype(), http_texthtml) == 0) {
|
if(strstr(webclient_mimetype(), http_html + 1) != 0) {
|
||||||
count = (count + 1) & 3;
|
count = (count + 1) & 3;
|
||||||
show_statustext(receivingmsgs[count]);
|
show_statustext(receivingmsgs[count]);
|
||||||
htmlparser_parse(data, len);
|
htmlparser_parse(data, len);
|
||||||
|
|
|
@ -6,9 +6,8 @@ http_get "GET "
|
||||||
http_10 "HTTP/1.0"
|
http_10 "HTTP/1.0"
|
||||||
http_11 "HTTP/1.1"
|
http_11 "HTTP/1.1"
|
||||||
http_content_type "content-type: "
|
http_content_type "content-type: "
|
||||||
http_texthtml "text/html"
|
|
||||||
http_location "location: "
|
http_location "location: "
|
||||||
http_host "host: "
|
http_host "Host: "
|
||||||
http_crnl "\r\n"
|
http_crnl "\r\n"
|
||||||
http_index_htm "/index.htm"
|
http_index_htm "/index.htm"
|
||||||
http_index_html "/index.html"
|
http_index_html "/index.html"
|
||||||
|
|
|
@ -22,15 +22,12 @@ const char http_11[9] =
|
||||||
const char http_content_type[15] =
|
const char http_content_type[15] =
|
||||||
/* "content-type: " */
|
/* "content-type: " */
|
||||||
{0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, };
|
{0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, };
|
||||||
const char http_texthtml[10] =
|
|
||||||
/* "text/html" */
|
|
||||||
{0x74, 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, };
|
|
||||||
const char http_location[11] =
|
const char http_location[11] =
|
||||||
/* "location: " */
|
/* "location: " */
|
||||||
{0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, };
|
{0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, };
|
||||||
const char http_host[7] =
|
const char http_host[7] =
|
||||||
/* "host: " */
|
/* "Host: " */
|
||||||
{0x68, 0x6f, 0x73, 0x74, 0x3a, 0x20, };
|
{0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20, };
|
||||||
const char http_crnl[3] =
|
const char http_crnl[3] =
|
||||||
/* "\r\n" */
|
/* "\r\n" */
|
||||||
{0xd, 0xa, };
|
{0xd, 0xa, };
|
||||||
|
|
|
@ -6,7 +6,6 @@ extern const char http_get[5];
|
||||||
extern const char http_10[9];
|
extern const char http_10[9];
|
||||||
extern const char http_11[9];
|
extern const char http_11[9];
|
||||||
extern const char http_content_type[15];
|
extern const char http_content_type[15];
|
||||||
extern const char http_texthtml[10];
|
|
||||||
extern const char http_location[11];
|
extern const char http_location[11];
|
||||||
extern const char http_host[7];
|
extern const char http_host[7];
|
||||||
extern const char http_crnl[3];
|
extern const char http_crnl[3];
|
||||||
|
|
Loading…
Reference in a new issue