Bug #4207
closedExternal links do not work with dedicated-process setting
0%
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 ?
Updated by Jacek Wro almost 10 years ago
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";
}
Updated by Jacek Wro almost 10 years ago
It seems that even WServer::setRedirectSecret(...) would be sufficient.
Updated by Koen Deforche almost 10 years ago
- 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
Updated by Benoit Daccache almost 10 years ago
- Status changed from InProgress to Resolved
Updated by Koen Deforche over 9 years ago
- Status changed from Resolved to Closed
Updated by Koen Deforche over 9 years ago
- Target version changed from 3.3.4 to 3.3.5