• exec/load/http.js

    From deuce@VERT to CVS commit on Thursday, March 26, 2015 01:30:35
    exec/load http.js 1.23 1.24
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv27335

    Modified Files:
    http.js
    Log Message:
    Support the https scheme for POSTs, do not add an extra CRLF after an Authentication header.




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From KenDB3@VERT/KD3NET to deuce on Friday, March 27, 2015 10:30:41
    exec/load http.js 1.23 1.24
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv27335

    Modified Files:
    http.js
    Log Message:
    Support the https scheme for POSTs, do not add an extra CRLF after an Authentication header.

    deuce,

    I saw this update and it made me think of another issue I've seen with HTTP and Posts. If there is a URL, the web server is smart enough to enclose it in a hyperlink, but if it is more than 80 characters, it will close the html tag at the end of the line, and the next line will continue with the URL's text, however not include it in the hyperlink. It's not a terrible thing, just annoying.

    I took a screen shot:
    http://bbs.kd3.us/junk/Long-URL.png
    compare that to:
    http://bbs.kd3.us/msgs/msg.ssjs?msg_sub=mrktplce&message=56

    ~KenDB3

    ---
    þ Synchronet þ KD3net-Rhode Island's only BBS about nothing. http://bbs.kd3.us
  • From echicken@VERT/ECBBS to KenDB3 on Friday, March 27, 2015 13:48:28
    Re: Re: exec/load/http.js
    By: KenDB3 to deuce on Fri Mar 27 2015 10:30:41

    HTTP and Posts. If there is a URL, the web server is smart enough to enclose it in a hyperlink, but if it is more than 80 characters, it will close the html tag at the end of the line, and the next line will continue with the URL's text, however not include it in the hyperlink. It's not a terrible thing, just annoying.

    Looking at 'web/root/msgs/msg.ssjs' I see the following at line 119:

    template.body=word_wrap(template.body,80);
    template.body=html_encode(template.body,true,false,false,false);
    template.body=make_links(template.body);

    So, word_wrap is breaking 'words' greater than 80 characters (the URL in the case of the message you linked to) and then make_links can only assume that the URL ends at the end of the line. Changing the order of things here won't really help, and disabling the word_wrap would cause other problems.

    I can think of a few hacky solutions, but none seem particularly great. One would be to turn 'make_links' into a two-stage affair. Others involve URL shorteners, either replacing URLs in messages permanently or at the time when a message is viewed on the web.

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-273-7230
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
  • From KenDB3@VERT/KD3NET to echicken on Friday, March 27, 2015 14:48:59
    Re: Re: exec/load/http.js
    By: KenDB3 to deuce on Fri Mar 27 2015 10:30:41

    HTTP and Posts. If there is a URL, the web server is smart enough to enclose it in a hyperlink, but if it is more than 80 characters, it will close the html tag at the end of the line, and the next line will continue with the URL's text, however not include it in the hyperlink. It's not a terrible thing, just annoying.

    Looking at 'web/root/msgs/msg.ssjs' I see the following at line 119:

    template.body=word_wrap(template.body,80);
    template.body=html_encode(template.body,true,false,false,false);
    template.body=make_links(template.body);

    So, word_wrap is breaking 'words' greater than 80 characters (the URL in the case of the message you linked to) and then make_links can only
    assume that the URL ends at the end of the line. Changing the order of things here won't really help, and disabling the word_wrap would cause other problems.

    I can think of a few hacky solutions, but none seem particularly great. One would be to turn 'make_links' into a two-stage affair. Others
    involve URL shorteners, either replacing URLs in messages permanently or at the time when a message is viewed on the web.

    Hmmmm... that sounds fairly involved for something I would call an "annoyance" rather than a problem. I have actually set up my own URL Shortener for another web site (using YOURLS, great system, http://yourls.org ), but I'm nowhere near clever enough to code my own solution.

    All in all, I figured it never hurts to ask, but I'd hate to hand anyone a bag of work that doesn't give all that much benefit besides edge case scenarios. Thanks for giving me the low down on how it is actually doing the magic behind the scenes.

    ~KenDB3

    ---
    þ Synchronet þ KD3net-Rhode Island's only BBS about nothing. http://bbs.kd3.us
  • From Deuce@VERT/SYNCNIX to KenDB3 on Saturday, April 04, 2015 02:19:52
    Re: Re: exec/load/http.js
    By: KenDB3 to deuce on Fri Mar 27 2015 10:30 am

    I saw this update and it made me think of another issue I've seen with HTTP and Posts. If there is a URL, the web server is smart enough to enclose it in a hyperlink, but if it is more than 80 characters, it will close the html tag at the end of the line, and the next line will continue with the URL's text, however not include it in the hyperlink. It's not a terrible thing, just annoying.

    I took a screen shot:
    http://bbs.kd3.us/junk/Long-URL.png
    compare that to:
    http://bbs.kd3.us/msgs/msg.ssjs?msg_sub=mrktplce&message=56

    Yeah, the word wrap will insert a linefeed there since it wraps to 80 columns. Other web message interfaces may not do that... especially if they don't go for
    the "BBS look".

    The current default web interface isn't one I'm really interested in working on
    anymore though, sorry.

    ---
    http://DuckDuckGo.com/ a better search engine that respects your privacy.
    þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)
  • From KenDB3@VERT/KD3NET to Deuce on Sunday, April 05, 2015 07:48:13
    Re: Re: exec/load/http.js
    By: KenDB3 to deuce on Fri Mar 27 2015 10:30 am

    I saw this update and it made me think of another issue I've seen with HTTP and Posts. If there is a URL, the web server is smart enough to enclose it in a hyperlink, but if it is more than 80 characters, it will close the html tag at the end of the line, and the next line will continue with the URL's text, however not include it in the hyperlink. It's not a terrible thing, just annoying.

    I took a screen shot:
    http://bbs.kd3.us/junk/Long-URL.png
    compare that to: http://bbs.kd3.us/msgs/msg.ssjs?msg_sub=mrktplce&message=56

    Yeah, the word wrap will insert a linefeed there since it wraps to 80 columns. Other web message interfaces may not do that... especially if they don't go for the "BBS look".

    The current default web interface isn't one I'm really interested in working on anymore though, sorry.

    That's cool, I figured it doesn't hurt to ask. Thanks for the reply though. :-)

    ~KenDB3

    ---
    þ Synchronet þ KD3net-Rhode Island's only BBS about nothing. http://bbs.kd3.us
  • From deuce@VERT to CVS commit on Tuesday, May 05, 2015 19:08:44
    exec/load http.js 1.24 1.25
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv30076

    Modified Files:
    http.js
    Log Message:
    Fix use of global i variable.
    Add Head method to do a HEAD request.




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From deuce@VERT to CVS commit on Thursday, May 12, 2016 18:48:34
    exec/load http.js 1.28 1.29
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv26778/load

    Modified Files:
    http.js
    Log Message:
    Fix long-standing problem POSTing very large entities (when using new Synchronet builds). Use multiple send()s when needed.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From rswindell@VERT to CVS commit on Tuesday, February 06, 2018 17:31:37
    exec/load http.js 1.30 1.31
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv4097

    Modified Files:
    http.js
    Log Message:
    Use non-blocking operations. I've seen disconnected terminal server users
    stuck in an infinite loop in socket.recv(), called from here, trying read
    data from an HTTPS connection.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Tuesday, February 06, 2018 18:25:34
    exec/load http.js 1.31 1.32
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv9482

    Modified Files:
    http.js
    Log Message:
    Revert the previous commit. SyncWX failed (http requests) with the socket created as non-blocking. :-(
    This whole script would need to be updated to support non-blocking sockets
    it looks like.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Sunday, February 25, 2018 23:43:32
    exec/load http.js 1.34 1.35
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv1499

    Modified Files:
    http.js
    Log Message:
    prototypify HTTP object. No need for everyone to have their own private
    copies of all the methods.




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Sunday, February 25, 2018 23:50:19
    exec/load http.js 1.35 1.36
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv2148

    Modified Files:
    http.js
    Log Message:
    SyncJSLint found a big in extra_headers handling. Fix that and everything
    else it found.




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Sunday, February 25, 2018 23:52:56
    exec/load http.js 1.36 1.37
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv2439

    Modified Files:
    http.js
    Log Message:
    Allow specifying the content-type in a Post().




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Monday, February 26, 2018 16:04:31
    exec/load http.js 1.37 1.38
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv4190/load

    Modified Files:
    http.js
    Log Message:
    Simple support for overriding User-Agent string.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Monday, February 26, 2018 16:06:28
    exec/load http.js 1.38 1.39
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv4393/load

    Modified Files:
    http.js
    Log Message:
    thus -> this



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From echicken@VERT to CVS commit on Thursday, March 15, 2018 11:28:13
    exec/load http.js 1.39 1.40
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv22671

    Modified Files:
    http.js
    Log Message:
    That 'this' was not the 'this' that your 'self' was looking for there then.
    May resolve the error reported by Bill McGarrity (this.extra_headers is undefined).



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From echicken@VERT to CVS commit on Thursday, March 15, 2018 12:22:59
    exec/load http.js 1.40 1.41
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv29446

    Modified Files:
    http.js
    Log Message:
    Ditch the 'self' stuff and give forEach a thisArg instead.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Monday, April 02, 2018 01:29:31
    exec/load http.js 1.41 1.42
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv10085

    Modified Files:
    http.js
    Log Message:
    When sending a request and the socket is still open, close it.
    This prevents leaving all sockets open until the script exits. It would
    be better to reuse the existing socket when it's already connected to the
    right place, but this is easier for now.




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Monday, August 05, 2019 21:13:22
    exec/load http.js 1.43 1.44
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv8343

    Modified Files:
    http.js
    Log Message:
    Use ConnectedSocket() to get IPv6 goodness.




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sunday, April 05, 2020 16:35:01
    exec/load http.js 1.44 1.45
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv20352

    Modified Files:
    http.js
    Log Message:
    Add a status definition with the most common request status codes since a caller of HTTPRequest.Get() needs to compare against these constants
    to know if the request was successful (e.g. ok = 200).


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From echicken@VERT to CVS commit on Tuesday, July 21, 2020 21:26:28
    exec/load http.js 1.45 1.46
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv23764

    Modified Files:
    http.js
    Log Message:
    For GET requests, follow 301, 302, 307, and 308 redirects to the first
    Location given in the response header, if present. Not enabled by
    default, so turn it on like so:

    var h = new HTTPRequest();
    h.follow_redirects = true;

    Should probably add "too many redirects" protection, since this could
    turn into an eternal game of HTTP ping-pong.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From echicken@VERT to CVS commit on Tuesday, July 21, 2020 21:31:48
    exec/load http.js 1.46 1.47
    Update of /cvsroot/sbbs/exec/load
    In directory cvs:/tmp/cvs-serv24583

    Modified Files:
    http.js
    Log Message:
    Shitty hack on previous commit.
    Amended HTTPRequest.follow_redirects to be a number instead of boolean.

    var h = new HTTPRequest();
    h.follow_redirects = 1; // We'll follow this many redirects



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to sbbs/master on Wednesday, August 26, 2020 20:36:37
    https://gitlab.synchro.net/sbbs/sbbs/-/commit/39f15ed27aaa1d54a06dd5a6
    Modified Files:
    exec/load/http.js
    Log Message:
    Better error reporting to help root-caues Nelgin's problem using bccnews.js

    <nelgin> !JavaScript : uncaught exception: Unknown scheme! 'undefined'
    <nelgin> (error with no line number) is the worst.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From echicken@VERT to Git commit to main/sbbs/master on Friday, January 22, 2021 10:50:35
    https://gitlab.synchro.net/main/sbbs/-/commit/d802a7c951555b1dc7135a3c
    Modified Files:
    exec/load/http.js
    Log Message:
    Sub in original scheme://host[:port] if absent from Location on redirect.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¨@VERT to Git commit to main/sbbs/master on Monday, February 15, 2021 15:51:05
    https://gitlab.synchro.net/main/sbbs/-/commit/aeb26cba8747e3adeca26d39
    Modified Files:
    exec/load/http.js
    Log Message:
    Parse redirects the easy way.

    I'm not sure what echicken was trying here, but apparently it doesn't
    work for nelgin.

    Likely fixes #220.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¨@VERT to Git commit to main/sbbs/master on Monday, February 15, 2021 15:54:07
    https://gitlab.synchro.net/main/sbbs/-/commit/5379321a722821aab964b2ab
    Modified Files:
    exec/load/http.js
    Log Message:
    Less tired.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¨@VERT to Git commit to main/sbbs/master on Monday, February 15, 2021 19:01:21
    https://gitlab.synchro.net/main/sbbs/-/commit/69dc58973f60f0caf9added6
    Modified Files:
    exec/load/http.js
    Log Message:
    Parse redirects the easy way.

    I'm not sure what echicken was trying here, but apparently it doesn't
    work for nelgin.

    Likely fixes #220.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¨@VERT to Git commit to main/sbbs/master on Monday, February 15, 2021 19:01:21
    https://gitlab.synchro.net/main/sbbs/-/commit/b9c69894964b2c6ec7d6a4a5
    Modified Files:
    exec/load/http.js
    Log Message:
    Less tired.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¨@VERT to Git commit to main/sbbs/master on Monday, February 15, 2021 19:14:16
    https://gitlab.synchro.net/main/sbbs/-/commit/21a3882f8c03fc4426088db4
    Modified Files:
    exec/load/http.js
    Log Message:
    Parse redirects the easy way.

    I'm not sure what echicken was trying here, but apparently it doesn't
    work for nelgin.

    Likely fixes #220.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¨@VERT to Git commit to main/sbbs/master on Monday, February 15, 2021 19:14:16
    https://gitlab.synchro.net/main/sbbs/-/commit/8311170c1b66bdda0adfe71f
    Modified Files:
    exec/load/http.js
    Log Message:
    Less tired.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¨@VERT to Git commit to main/sbbs/master on Monday, February 15, 2021 19:31:37
    https://gitlab.synchro.net/main/sbbs/-/commit/dfd7e11c58b1fd3b53c2c0dc
    Modified Files:
    exec/load/http.js
    Log Message:
    Parse redirects the easy way.

    I'm not sure what echicken was trying here, but apparently it doesn't
    work for nelgin.

    Likely fixes #220.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¨@VERT to Git commit to main/sbbs/master on Monday, February 15, 2021 19:31:37
    https://gitlab.synchro.net/main/sbbs/-/commit/2cbf30304429df5ebee5cf09
    Modified Files:
    exec/load/http.js
    Log Message:
    Less tired.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Sunday, May 07, 2023 18:11:16
    https://gitlab.synchro.net/main/sbbs/-/commit/088b87a4b8c8e2e43a88af2d
    Modified Files:
    exec/load/http.js
    Log Message:
    Support recv_timeout argument to HTTPRequest constructor, default: 60 (seconds)

    Use this time-out value for calls to recv() and recvline() rather than a mix of default and hard-coded values. If unspecified, uses a default of 60 seconds.

    This fixes issue #562

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net