Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Commit

Permalink
Replaced "servingurl" in valuesCache[name]["dest"] with more resilien…
Browse files Browse the repository at this point in the history
…t valuesCache[name]["dest"].get("servingurl") test

From #28
  • Loading branch information
tsteinruecken committed Nov 27, 2018
1 parent 10fe12e commit 2a6f4da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bones/fileBone.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ def unserialize( self, valuesCache, name, expando ):
res = super( fileBone, self ).unserialize( valuesCache, name, expando )
if not request.current.get().isDevServer:
# Rewrite all "old" Serving-URLs to https if we are not on the development-server
if isinstance(valuesCache[name], dict) and "servingurl" in valuesCache[name]["dest"]:
if isinstance(valuesCache[name], dict) and valuesCache[name]["dest"].get("servingurl"):
if valuesCache[name]["dest"]["servingurl"].startswith("http://"):
valuesCache[name]["dest"]["servingurl"] = valuesCache[name]["dest"]["servingurl"].replace("http://","https://")
elif isinstance( valuesCache[name], list ):
for val in valuesCache[name]:
if isinstance(val, dict) and "servingurl" in val["dest"]:
if isinstance(val, dict) and val["dest"].get("servingurl"):
if val["dest"]["servingurl"].startswith("http://"):
val["dest"]["servingurl"] = val["dest"]["servingurl"].replace("http://","https://")
if isinstance(valuesCache[name], dict):
Expand Down

0 comments on commit 2a6f4da

Please sign in to comment.