diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am
index 63cc4729f3..7faa27da35 100644
--- a/tests/data/Makefile.am
+++ b/tests/data/Makefile.am
@@ -110,9 +110,9 @@ test736 test737 test738 test739 test740 test741 test742 test743 test744 \
test745 test746 test747 test748 test749 test750 test751 test752 test753 \
test754 test755 test756 test757 test758 test759 test760 test761 test762 \
test763 test764 test765 test766 test767 test768 test769 test770 test771 \
-test772 test773 test774 test775 test776 test777 \
-test780 test781 test782 test783 test784 test785 test786 test787 test788 \
-test789 test790 test791 test792 test793 test794 test796 test797 \
+test772 test773 test774 test775 test776 test777 test778 test779 test780 \
+test781 test782 test783 test784 test785 test786 test787 test788 test789 \
+test790 test791 test792 test793 test794 test795 test796 test797 \
\
test799 test800 test801 test802 test803 test804 test805 test806 test807 \
test808 test809 test810 test811 test812 test813 test814 test815 test816 \
diff --git a/tests/data/test778 b/tests/data/test778
new file mode 100644
index 0000000000..84e84b8cd3
--- /dev/null
+++ b/tests/data/test778
@@ -0,0 +1,97 @@
+
+
+
+HTTP
+HTTP proxy
+HTTP Basic auth
+HTTP proxy Basic auth
+followlocation
+oauth2-bearer
+
+
+#
+# Server-side
+
+
+HTTP/1.1 302 OK
+Date: Tue, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Location: http://goto.second.host.now/%TESTNUMBER0002
+Content-Length: 8
+Connection: close
+
+contents
+
+
+HTTP/1.1 200 OK
+Date: Tue, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Content-Length: 9
+
+contents
+
+
+
+HTTP/1.1 302 OK
+Date: Tue, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Location: http://goto.second.host.now/%TESTNUMBER0002
+Content-Length: 8
+Connection: close
+
+HTTP/1.1 200 OK
+Date: Tue, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Content-Length: 9
+
+contents
+
+
+
+#
+# Client-side
+
+
+http
+
+
+HTTP --oauth2-bearer redirect to new host (not passed on)
+
+
+http://first.host.it.is/we/want/that/page/%TESTNUMBER -x %HOSTIP:%HTTPPORT --oauth2-bearer s3cr3t --proxy-user testing:this --location
+
+
+proxy
+
+
+
+#
+# Verify data after the test has been "shot"
+
+
+GET http://first.host.it.is/we/want/that/page/%TESTNUMBER HTTP/1.1
+Host: first.host.it.is
+Proxy-Authorization: Basic %b64[testing:this]b64%
+Authorization: Bearer s3cr3t
+User-Agent: curl/%VERSION
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET http://goto.second.host.now/%TESTNUMBER0002 HTTP/1.1
+Host: goto.second.host.now
+Proxy-Authorization: Basic %b64[testing:this]b64%
+User-Agent: curl/%VERSION
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+
+
+
diff --git a/tests/data/test779 b/tests/data/test779
new file mode 100644
index 0000000000..f833c3782c
--- /dev/null
+++ b/tests/data/test779
@@ -0,0 +1,76 @@
+
+
+
+HTTP
+IMAP
+oauth2-bearer
+followlocation
+
+
+#
+# Server-side
+
+
+AUTH XOAUTH2
+REPLY AUTHENTICATE +
+REPLY dXNlcj12AWF1dGg9QmVhcmVyIHMzY3IzdAEB B002 OK AUTHENTICATE completed
+
+
+HTTP/1.1 302 OK
+Date: Tue, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Location: imap://v@host:%IMAPPORT/%TESTNUMBER0002/
+Content-Length: 8
+Connection: close
+
+contents
+
+
+
+HTTP/1.1 302 OK
+Date: Tue, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Location: imap://v@host:%IMAPPORT/%TESTNUMBER0002/
+Content-Length: 8
+Connection: close
+
+
+
+
+#
+# Client-side
+
+
+http
+imap
+
+
+HTTP --oauth2-bearer redirects to IMAP
+
+
+http://%HOSTIP:%HTTPPORT/page/%TESTNUMBER --oauth2-bearer s3cr3t --location --proto-redir imap --resolve host:%IMAPPORT:%HOSTIP
+
+
+
+#
+# Verify data after the test has been "shot"
+
+
+GET /page/%TESTNUMBER HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Authorization: Bearer s3cr3t
+User-Agent: curl/%VERSION
+Accept: */*
+
+B001 CAPABILITY
+
+# curl: (67) Login denied
+
+67
+
+
+
diff --git a/tests/data/test795 b/tests/data/test795
new file mode 100644
index 0000000000..ab33ea5be6
--- /dev/null
+++ b/tests/data/test795
@@ -0,0 +1,74 @@
+
+
+
+HTTP
+IMAP
+followlocation
+
+
+#
+# Server-side
+
+
+AUTH PLAIN
+CAPA SASL-IR
+REPLY AUTHENTICATE B002 OK AUTHENTICATE completed
+
+
+HTTP/1.1 302 OK
+Date: Tue, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Location: imap://v@host:%IMAPPORT/%TESTNUMBER0002/
+Content-Length: 8
+Connection: close
+
+contents
+
+
+
+HTTP/1.1 302 OK
+Date: Tue, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Content-Type: text/html
+Funny-head: yesyes
+Location: imap://v@host:%IMAPPORT/%TESTNUMBER0002/
+Content-Length: 8
+Connection: close
+
+
+
+
+#
+# Client-side
+
+
+http
+imap
+
+
+HTTP with credentials redirects to IMAP
+
+
+http://@%HOSTIP:%HTTPPORT/page/%TESTNUMBER -u user:secret --location --proto-redir imap --resolve host:%IMAPPORT:%HOSTIP
+
+
+
+#
+# Verify data after the test has been "shot"
+
+
+GET /page/%TESTNUMBER HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Authorization: Basic %b64[user:secret]b64%
+User-Agent: curl/%VERSION
+Accept: */*
+
+B001 CAPABILITY
+B002 AUTHENTICATE PLAIN AHYA
+B003 LIST "%TESTNUMBER0002" *
+B004 LOGOUT
+
+
+