fix 301 and 302 not redirecting in http(s) proxy
- also add experimental beta mail signature preview option
This commit is contained in:
@@ -6,12 +6,19 @@ var messageid = request_headers.query.message_id || null;
|
||||
if (!messageid) {
|
||||
// get user signature
|
||||
data = session_data.getSessionData("subscriber_signature");
|
||||
if (request_headers.query.demotext) data += "<br>" + request_headers.query.demotext;
|
||||
} else {
|
||||
// get message signature
|
||||
var message = session_data.mailstore.getMessageByID(messageid);
|
||||
if (!message) errpage = wtvshared.doErrorPage(400, "Invalid Message ID");
|
||||
data = message.signature
|
||||
}
|
||||
|
||||
if (request_headers.query.sanitize) {
|
||||
var message_colors = session_data.mailstore.getSignatureColors(data)
|
||||
data = wtvshared.sanitizeSignature(data).replace("<html>", `<html><body bgcolor=${message_colors.bgcolor} text=${message_colors.text} link=${message_colors.link} vlink=${message_colors.vlink} vspace=0 hspace=0>`);
|
||||
|
||||
}
|
||||
if (!errpage) {
|
||||
headers = `200 OK
|
||||
wtv-trusted: false
|
||||
|
||||
@@ -99,13 +99,18 @@ font=proportional>${session_data.getSessionData("subscriber_signature") || ""}</
|
||||
<tr>
|
||||
<TD>
|
||||
<td colspan=3 height=2 valign=top align=left bgcolor="0D0D0D">
|
||||
${(request_headers.query.preview) ? `<b>Signature Preview:</b><br><br><embed src="wtv-mail:/get-signature?sanitize=true&demotext=${encodeURIComponent(`This is a preview of your signature. You can <a href="wtv-setup:/mail-signature">edit it here</a>.`)}" height=40></embed><br><br>` : ''}
|
||||
<img src="wtv-home:/ROMCache/Spacer.gif" width=436 height=1>
|
||||
<TR>
|
||||
<TD>
|
||||
<TD COLSPAN=4 HEIGHT=4 VALIGN=top ALIGN=left>
|
||||
<TR>
|
||||
<TD VALIGN=top ALIGN=left>
|
||||
<FORM action="mail-signature">
|
||||
<FONT COLOR="#E7CE4A" SIZE=-1><SHADOW>
|
||||
<INPUT TYPE=SUBMIT BORDERIMAGE="file://ROM/Borders/ButtonBorder2.bif" Value=Preview NAME="preview" USESTYLE WIDTH=103>
|
||||
</SHADOW></FONT></FORM>
|
||||
|
||||
<TD>
|
||||
<TD COLSPAN=3 VALIGN=top ALIGN=right>
|
||||
<TD VALIGN=top ALIGN=right>
|
||||
<FORM action="client:goback">
|
||||
<FONT COLOR="#E7CE4A" SIZE=-1><SHADOW>
|
||||
<INPUT TYPE=SUBMIT BORDERIMAGE="file://ROM/Borders/ButtonBorder2.bif" Value=Done NAME="Done" USESTYLE WIDTH=103>
|
||||
|
||||
@@ -812,6 +812,7 @@ async function doHTTPProxy(socket, request_headers) {
|
||||
port: request_data.port,
|
||||
path: request_data.path,
|
||||
method: request_data.method,
|
||||
followAllRedirects: true,
|
||||
headers: {
|
||||
"User-Agent": request_headers["User-Agent"] || "WebTV"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user