nci/gsky

WMS GetLegendGraphic requests fail

Closed this issue · 3 comments

The WMS GetCapabilities statement provides a LegendURL for all layers (at http://gsky.nci.org.au/ows), although GetLegendGraphic requests fail with a 500 status response for all layers except the two DEA Intertidal Extents layers. Error message is:

open : no such file or directory

As far as I know, True and False colour Landsat composites do not have legends or color scales associated with them. I will continue this bug thread assuming that the problem is that the http response for a resource not found should be 404 instead of 500. Let us know if this is not the intention.

gsky/ows.go

Line 266 in 24610a4

case "GetLegendGraphic":

Should check for the existence of a Legend file in the config file for that layer and respond with 404 error message if not found>

The issue here is that the GetCaps is advertising legends that do not exist. I suggest excluding the LegendURL elements in the GetCapabilities statement from those layers that do not have a legend (it's not mandatory in the XML Schema). This should prevent requests for the legend graphic from occurring in the first place, although if a user makes a request anyway, then yes, I think a 404 status response would be more appropriate than a 500.

bje- commented

@edisonguo reports this is fixed.