Skip to content

Commit

Permalink
Merge pull request #9070 from internetarchive/cdrini-patch-8
Browse files Browse the repository at this point in the history
Partially fix static images not working in gitpod
  • Loading branch information
cdrini authored Jun 21, 2024
2 parents e973346 + d8221ef commit fc3ae11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions openlibrary/plugins/openlibrary/js/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ registerRoute(
maxEntries: 100,
maxAgeSeconds: DAY_SECONDS * 365,
}),
cacheableResponses
],
})
);
Expand Down
5 changes: 3 additions & 2 deletions openlibrary/plugins/upstream/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@
logger = logging.getLogger('openlibrary.plugins.upstream.code')


# Note: This is done in web_nginx.conf on production ; this endpoint is
# only used in development/gitpod.
class static(delegate.page):
path = "/images/.*"

def GET(self):
host = 'https://%s' % web.ctx.host if 'openlibrary.org' in web.ctx.host else ''
raise web.seeother(host + '/static' + web.ctx.path)
return web.seeother(f'/static{web.ctx.path}')


class history(delegate.mode):
Expand Down

0 comments on commit fc3ae11

Please sign in to comment.