Project

General

Profile

Actions

Bug #4207

closed

External links do not work with dedicated-process setting

Added by Jacek Wro over 9 years ago. Updated about 9 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 ?

Actions #1

Updated by Jacek Wro over 9 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";
}
Actions #2

Updated by Jacek Wro over 9 years ago

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

Actions #3

Updated by Koen Deforche over 9 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

Actions #4

Updated by Benoit Daccache over 9 years ago

  • Status changed from InProgress to Resolved
Actions #5

Updated by Koen Deforche about 9 years ago

  • Status changed from Resolved to Closed
Actions #6

Updated by Koen Deforche about 9 years ago

  • Target version changed from 3.3.4 to 3.3.5
Actions

Also available in: Atom PDF