Project

General

Profile

Actions

Bug #11423

closed

Wt warns about WResource::setInternalPath(): adding '/' to start of internal path for static resources

Added by Roel Standaert over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Roel Standaert
Target version:
Start date:
03/10/2023
Due date:
% Done:

100%

Estimated time:

Description

Since Wt 4.1.0 we prepend the --deploy-path to static resources deployed at a path that doesn't start with a slash.

We still get this warning however:

WResource: setInternalPath(): adding '/' to start of internal path:

Attached is some sample code to demonstrate this issue.

Some proposed solutions:

  • Don't do setInternalPath() in WServer::addResource(). WResource::internalPath() would then just return the empty string for static resources. This would change the behavior of internalPath(). I'm not sure if anyone is relying on it, though, since it doesn't really make much sense for a static resource.
  • Also prepend the deployment path before setting the internal path. WResource::internalPath() would then be the last path assigned with addResource, with the deploy-path prepended.

Files

resource_internalpath.cpp (1.23 KB) resource_internalpath.cpp Roel Standaert, 03/10/2023 11:09 AM
Actions #1

Updated by Roel Standaert over 1 year ago

  • Status changed from New to InProgress
  • Assignee set to Roel Standaert
Actions #2

Updated by Roel Standaert over 1 year ago

  • Status changed from InProgress to Review
  • Assignee deleted (Roel Standaert)
Actions #3

Updated by Roel Standaert over 1 year ago

  • Target version set to 4.10.0
Actions #4

Updated by Roel Standaert over 1 year ago

Turns out we're already setting the WResource::url() to be the entire path. I think then it's probably most accurate to not call setInternalPath(...), since internalPath() doesn't make sense in the case of static resources (There's no WApplication, so internal to what?).

Actions #5

Updated by Roel Standaert over 1 year ago

  • Status changed from Review to Implemented @Emweb
  • Assignee set to Roel Standaert
  • % Done changed from 0 to 100
Actions #6

Updated by Roel Standaert over 1 year ago

  • Status changed from Implemented @Emweb to Resolved
Actions #7

Updated by Matthias Van Ceulebroeck over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF