Skip to content

Commit 3608758

Browse files
author
Ace Nassri
authored
fix(appengine/static-service): fix non-extension'ed file handling (GoogleCloudPlatform#7801)
This was tested locally, but **not on App Engine**. (It's a simple enough change, so I figured it didn't require a full deployment **if** we know the underlying sample works.)
1 parent 89ece51 commit 3608758

File tree

1 file changed

+2
-2
lines changed
  • appengine/flexible/multiple_services/static-service

1 file changed

+2
-2
lines changed

appengine/flexible/multiple_services/static-service/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ def root():
3333
def static_file(path):
3434
"""serves static files required by index.html"""
3535
mimetype = ''
36-
if path.split('.')[1] == 'css':
36+
if '.' in path and path.split('.')[1] == 'css':
3737
mimetype = 'text/css'
38-
if path.split('.')[1] == 'js':
38+
if '.' in path and path.split('.')[1] == 'js':
3939
mimetype = 'application/javascript'
4040
return app.send_static_file(path), 200, {'Content-Type': mimetype}
4141

0 commit comments

Comments
 (0)