Project

General

Profile

Actions

Bug #4207

closed
JW BD

External links do not work with dedicated-process setting

Bug #4207: External links do not work with dedicated-process setting

Added by Jacek Wro about 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Benoit Daccache
Target version:
Start date:
06/22/2015
Due date:
% Done:

0%

Estimated time:

Description

When external links are created (for example in WText or WAnchor) they are modified to be passed through redirect page and they look for example like this:

http://127.0.0.1:9091/?request=redirect&url=http://google.com&hash=tZjUtaAo2x5ZE4xWU6e0%2bA%3d%3d

As you can see URL and hash are passed in the request. Unfortunately (when using dedicated-process option) redirect page is handled by different process. It has different WebControllrer instance, which has different value for WebControllrer::redirectSecret_ member. Because of that hash recalculated in parent is different and safety check always returns error and "Invalid redirect" page is displayed by (WebController::handleRequest(...).

Proposed solution:
You already pass ---parent-port from parent to child process via command line.
Maybe ---parent-secret would be sufficient ?

JW Updated by Jacek Wro about 11 years ago Actions #1

To confirm my theory I found that there are two WebControllers (one in WServer and the other in WApplication). I included appropriate headers from src, I accessed those private redirectSecret_ members and set them to the same value. And now it works :) !

Simplest solution:
Just give possibility to set the secret (something like WServer::setRedirectSecret(...) and WApplication::setRedirectSecret(...)) and it will be up to the client code to maintain same secret across many processes.

Code I used:

#define private public
#include "d:\Download\wt-3.3.4\src\web\WebSession.h"
#include "d:\Download\wt-3.3.4\src\web\WebController.h"
#undef public

...

WServer server( args[ 0 ] );
server.setServerConfiguration( args.size(), args.data(), myConfigFile );
server.controller()->redirectSecret_ = "12345";

...

MyApplication::MyApplication( const WEnvironment & env )
    : WApplication( env )
{
    session()->controller()->redirectSecret_ = "12345";
}

JW Updated by Jacek Wro about 11 years ago Actions #2

It seems that even WServer::setRedirectSecret(...) would be sufficient.

KD Updated by Koen Deforche about 11 years ago Actions #3

  • Status changed from New to InProgress
  • Assignee set to Benoit Daccache

This is another piece of information that should be copied from the process manager to the session process

BD Updated by Benoit Daccache about 11 years ago Actions #4

  • Status changed from InProgress to Resolved

KD Updated by Koen Deforche almost 11 years ago Actions #5

  • Status changed from Resolved to Closed

KD Updated by Koen Deforche almost 11 years ago Actions #6

  • Target version changed from 3.3.4 to 3.3.5
Actions

Also available in: PDF Atom