Incorrect URL for custom legend graphic

Description

WMS Capabilities response contains incorrect URL for GetLegendGraphic request when using custom legend image. It's missing path to "styles" directory.

Steps to reproduce:

  1. Open the "grass" style in the style editor.

  2. Click on Add legend, type in "grass_fill.png" (file existing in default data_dir/styles).

  3. Click on "Auto-detect image and size" link. All legend fields are auto filled correctly (width and height is 32, format is image/png;charset=UTF-8).

  4. Save the style.

  5. Make a WMS GetCapabilites request and look for the URL of the grass style in tigeroly_landmarks layer. It's http://localhost:8080/geoserver/grass_fill.png which is incorrect. The correct link is http://localhost:8080/geoserver/styles/grass_fill.png

Environment

  • Apache Tomcat 8.0.30 or embedded Jetty

  • JRE 1.8.0_25

Status

Assignee

Unassigned

Reporter

Peter Kovac

Triage

None

Fix versions

Affects versions

Components

Priority

Low
Configure