[links] Links-hacked: Hotmail fixes

Vedran Ljubović <[email protected]> Mon, 25 Oct 2004 22:14:23 +0200
Newsgroups gmane.comp.web.links.list
Organization Europronet d.o.o.
Message-ID <[email protected]>
Hello,
I have fixed two minor bugs that prevented logging into Hotmail. One prevented 
redirection when clicking on the link on www.msn.co.uk, and the other caused 
400 Bad Request. See screenshot:

http://members.smartnet.ba/vedran/links/hotmail-251004.png

Looks pretty :) Not very useful though, since the only thing you can click on 
is Sign Out, everything else is Javascript ;( I'll try to fix that soon.

_______________________________________________
Links-list mailing list
[email protected]
http://linuxfromscratch.org/mailman/listinfo/links-list
links-hotmail.diff (text/x-diff, 1.3 KB)
--- links-hacked-031220/http.c	2004-10-17 11:54:40.000000000 +0200
+++ links-hacked/http.c	2004-10-25 21:52:48.940657880 +0200
@@ -77,6 +77,7 @@
 
 static int get_http_code(unsigned char *head, int *code, int *version)
 {
+	fprintf (stderr, "---------Primljeno:\n%s\n",head);
 	while (head[0] == ' ') head++;
 	if (upcase(head[0]) != 'H' || upcase(head[1]) != 'T' || upcase(head[2]) != 'T' ||
 	    upcase(head[3]) != 'P') return -1;
@@ -285,7 +286,7 @@
 		case REFERER_SAME_URL:
 		add_to_str(&hdr, &l, "Referer: ");
 		if (!post) add_to_str(&hdr, &l, c->url);
-		else add_bytes_to_str(&hdr, &l, u, post - c->url - 1);
+		else add_bytes_to_str(&hdr, &l, c->url, post - c->url - 1);
 		add_to_str(&hdr, &l, "\r\n");
 		break;
 
--- links-hacked-031220/url.c	2004-10-17 11:54:40.000000000 +0200
+++ links-hacked/url.c	2004-10-25 19:28:06.017662816 +0200
@@ -99,7 +99,7 @@
 		return 0;
 	}
 	p += 3;
-	q = p + strcspn(p, "@/");
+	q = p + strcspn(p, "@/?");
 	if (!*q && protocols[a].need_slash_after_host) return -1;
 	if (*q == '@') {
 		unsigned char *pp = strchr(p, ':');
@@ -114,7 +114,7 @@
 		}
 		p = q + 1;
 	} 
-	q = p + strcspn(p, ":/");
+	q = p + strcspn(p, ":/?");
 	if (!*q && protocols[a].need_slash_after_host) return -1;
 	if (host) *host = p;
 	if (holen) *holen = q - p;