If the referer is not set, use fullpath.
Call store_location_for once.
Merge branch 'use_fullpath' into 'master'

If referer in request is incorrect use fullpath

Fixes #1444

See merge request !982