Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Strand Lab
Strand Lab Cellxgene Gateway
Commits
9c17e2ff
Commit
9c17e2ff
authored
Jan 18, 2021
by
Gregor Sturm
Browse files
Fix redirect in cache_entry
parent
fbc18fb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
cellxgene_gateway/cache_entry.py
View file @
9c17e2ff
...
...
@@ -8,6 +8,8 @@
# the specific language governing permissions and limitations under the License.
import
datetime
import
logging
from
flask.helpers
import
url_for
from
flask.wrappers
import
Response
import
psutil
from
enum
import
Enum
...
...
@@ -120,7 +122,7 @@ class CacheEntry:
return
gateway_content
def
gateway_basepath
(
self
):
return
f
"
{
env
.
external_protocol
}
://
{
env
.
external_host
}
/view/
{
self
.
key
.
pathpart
}
/"
return
url_for
(
"do_view"
,
path
=
self
.
key
.
pathpart
)
+
"
/"
def
cellxgene_basepath
(
self
):
return
f
"http://127.0.0.1:
{
self
.
port
}
"
...
...
@@ -130,7 +132,7 @@ class CacheEntry:
subpath
=
path
[
len
(
self
.
key
.
pathpart
)
:]
# noqa: E203
if
len
(
subpath
)
==
0
:
r
=
make_response
(
f
"Redirect to
{
gateway_basepath
}
\n
"
,
30
1
)
r
=
make_response
(
f
"Redirect to
{
gateway_basepath
}
\n
"
,
30
2
)
r
.
headers
[
"location"
]
=
gateway_basepath
+
querystring
()
return
r
elif
self
.
status
==
CacheEntryStatus
.
loading
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment