kartoza / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
http://geonode.org/
GNU General Public License v3.0
8 stars 17 forks source link

access_token query string on resource.get_legend.url causes legend image to not appear #190

Closed gubuntu closed 7 years ago

gubuntu commented 7 years ago

From @senoadiw on January 26, 2017 11:4

Description

On recent GeoNode versions, for logged in users the access_token query string is appended to the resource.get_legend.url in https://github.com/GeoNode/geonode/blob/47f2a42ff60be0c0c427b78df5e73a411ac2b2e1/geonode/layers/templates/layers/layer_detail.html#L430

For anonymous users the legend appears fine. Here is what it looks like as admin user:

docker-geonode-qgis legend

Thanks

_Copied from original issue: kartoza/geonode_qgisserver#11

gubuntu commented 7 years ago

From @ismailsunni on January 27, 2017 3:31

Thanks @senoadiw for the report. Well, I haven't tested with the current version of geonode. It seems, they added new code that geoserver-specific. But it doesn't cover QGIS Server, unfortunatelly.

gubuntu commented 7 years ago

From @timlinux on January 29, 2017 21:7

@ismailsunni we should write a regex to strip off the access token before passing the request downstream to QGIS server?

gubuntu commented 7 years ago

From @ismailsunni on January 30, 2017 1:5

Hmm, after looked at the code again, the access token should be ignored since it's a GET parameter and the legend should have been shown.

@timlinux yes, that can work

gubuntu commented 7 years ago

This issue was moved to kartoza/geonode#189

lucernae commented 7 years ago

@gubuntu I think I already fixed this in this commit: https://github.com/kartoza/geonode/commit/b4048997c98e4ac18fc2bc060ac672382bc3a1aa#diff-fb405571ea0edfcf565594881ab9c7e9

What I did is put access_token regex on urls.py of qgis_server. So it will be parsed but ignored.

gubuntu commented 7 years ago

Ok, if you've tested it then go ahead and close