Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if there are any query parameters in baseurl and adds it to location.search if possible #3214

Merged
merged 2 commits into from
Mar 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions panel/io/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,12 +488,24 @@ def headers(self):
def location(self):
if self.curdoc and self.curdoc not in self._locations:
from .location import Location
self._locations[self.curdoc] = loc = Location()
return loc
loc = self._locations[self.curdoc] = Location()
elif self.curdoc is None:
return self._location
loc = self._location
else:
return self._locations.get(self.curdoc) if self.curdoc else None
loc = self._locations.get(self.curdoc) if self.curdoc else None

if '?' in self.base_url:
try:
loc.search = f'?{self.base_url.split("?")[-1].strip("/")}'
except Exception:
pass
if '#' in self.base_url:
try:
loc.hash = f'#{self.base_url.split("#")[-1].strip("/")}'
except Exception:
pass

return loc

@property
def notifications(self):
Expand Down