ProxyRequest internal question (in functions.general.php)

eleitheleith New
edited July 2010 in Vanilla 2.0 - 2.8
i had problems setting up my single signon (ProxyConnect plugin) and i tracked it down to the ProxyRequest function which was not proxying the request to a different domain where my sign signon server was living (i have them separated on subdomains).

i tracked it down to the following line:
$HostHeader = $Host.($Post != 80) ? ":{$Port}" : '';
when i change it to pass in the host (which is different from the forum host)
$HostHeader = $Host.($Post != 80) ? "$Host:{$Port}" : '';
it works. any suggestions? not sure if this changes some expectations/assumptions, so i'm hesitant to do pull requests on git hub...

Comments

  • TimTim Vanilla Staff
    edited July 2010
    There is a typo in the original line that is causing this error.
    $HostHeader = $Host.($Post != 80) ? ":{$Port}" : '';
    should be
    $HostHeader = $Host.($Port != 80) ? ":{$Port}" : '';

    Make that change and it will work as expected. Your 'fix' actually ends up messing up the Host: by double appending the hostname.
    Host: hosthost:port

    Vanilla Forums COO [GitHub, Twitter, About.me]

  • eleitheleith New
    edited July 2010
    @tim, i don't see a difference in the two lines you posted above, am i seeing something wrong?

    as it stands, when i use
    $HostHeader = $Host.($Port != 80) ? ":{$Port}" : '';
    the proxy request goes out to (myforum.myhost.com/my/user/details) instead of (www.myhost.com/my/user/details) as specified in the config file for ProxyConnect.
  • TimTim Vanilla Staff
    The first usage of 'Port' is actually spelled 'Post'.

    Vanilla Forums COO [GitHub, Twitter, About.me]

  • thanks @tim.

    i got to the bottom of the error that i am experiencing. i made the following change:
    $HostHeader = $Host.($Port != 80) ? ":{$Port}" : '';
    to:
    $HostHeader = $Host.(($Port != 80) ? ":{$Port}" : '');
    doing an inline if/else without the parens just clobbers $Host otherwise when i run it.
  • TimTim Vanilla Staff
    Another good catch :_)

    Vanilla Forums COO [GitHub, Twitter, About.me]

Sign In or Register to comment.