Skip to content

Instantly share code, notes, and snippets.

@X4
Created September 13, 2011 09:55
Show Gist options
  • Select an option

  • Save X4/1213507 to your computer and use it in GitHub Desktop.

Select an option

Save X4/1213507 to your computer and use it in GitHub Desktop.
POST bug in google chrome/chromium
#include "gwan.h"
int main(int argc, char *argv[])
{
xbuf_t *reply = get_reply(argv);
xbuf_cat(reply,
"<form method='POST'>"
"<input name='post' type='text' value='Testing POST' />"
"<input type='submit' value='POST'/>"
"</form>"
);
char *post = "";
get_arg("post=", &post, argc, argv);
http_t *http = get_env(argv, HTTP_HEADERS, 0);
xbuf_xcat(reply, "<span>Browser: %s</span>", http->h_useragent);
xbuf_xcat(reply, "<script type=\"text/javascript\">console.log('POST: %s')</script>", post);
return 200;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment