Bug #8972
closedWResource::setInternalPath does not work
100%
Description
Following code works fine:
myResource_ = std::make_unique<MyResource>();
//myResource_->setInternalPath("myresource");
root()->addWidget(std::make_unique<WAnchor>(WLink(myResource_->url()), "Resource"));
(with MyResource subclass of WResource)
Clicking on the link displays the content generated by myResource_, as expected
However when the second line is uncommented the clicking on the link returns a 403 forbidden error.
Also entering the url as
http:///myresource or http:///?_=myresource
does not work. Tested with Wt 4.5.0
Updated by Geert Verbruggen over 3 years ago
Update: urls at the end are wrong (part was interpreted as markdown)
should be:
http://myserver/myresource or http://myserver/?_=myresource
Updated by Geert Verbruggen over 3 years ago
Cause of the error seems to be that &request=resource
is not added to the url for a WResource with internalPath set.
As a consequence requestForResource
evaluates to false at WebSession.C, line 1328, and request handling ends at WebSession.C line 1385:
if (env_->ajax()
&& isEqual(request.requestMethod(), "GET")
&& !requestForResource
&& conf.reloadIsNewSession()
&& wtdE && *wtdE == sessionId_) {
LOG_SECURE("Unexpected GET request with wtd of existing Ajax session");
serveError(403, handler, "Forbidden");
return;
}
Updated by Korneel Dumon about 3 years ago
- Status changed from New to InProgress
- Assignee set to Korneel Dumon
Thanks for reporting. Seems to be a regression because of https://redmine.webtoolkit.eu/issues/7585
Updated by Korneel Dumon about 3 years ago
- Status changed from InProgress to Review
Updated by Roel Standaert about 3 years ago
- Status changed from Review to Implemented @Emweb
- Target version changed from 4.7.0 to 4.6.0
Updated by Roel Standaert about 3 years ago
- Status changed from Implemented @Emweb to InProgress
Updated by Roel Standaert about 3 years ago
- Status changed from InProgress to Resolved
Updated by Roel Standaert almost 3 years ago
- Status changed from Resolved to Closed
Updated by Roel Standaert almost 3 years ago
- Related to Bug #9523: Wt 4.6.0 regression: possible null dereference in WebSession::resourceRequest added