Fix wrong download URL when serving behind reverse proxy

This commit is contained in:
rubenwardy 2018-03-24 23:10:13 +00:00
parent 69efdd7fde
commit 4b7bf9d778
2 changed files with 57 additions and 2 deletions

@ -27,7 +27,7 @@ def doPackageList(type):
query = query.filter(Package.title.contains(search))
if shouldReturnJson():
return jsonify([package.getAsDictionary(request.url_root) for package in query.all()])
return jsonify([package.getAsDictionary(app.config["BASE_URL"]) for package in query.all()])
else:
return render_template("packages/list.html", title=title, packages=query.all(), query=search)
@ -104,7 +104,7 @@ def package_page(type, author, name):
package = getPageByInfo(type, author, name)
if shouldReturnJson():
return jsonify(package.getAsDictionary(request.url_root))
return jsonify(package.getAsDictionary(app.config["BASE_URL"]))
else:
releases = getReleases(package)
requests = [r for r in package.requests if r.status == 0]

55
log.txt Normal file

@ -0,0 +1,55 @@
69efdd7 Add user rank changing
f51224a Add user list
4898b69 Fix script injection using markdown
c9073a8 Update README
287c9e5 Fix suggest changes link
cd77ad6 Use bash script to start server
6be5b3e Add registering using Github
bb9d589 Add EditRequest approval and rejection
a5042a9 Add EditRequest view page
dcfd2b0 Add EditRequest creation
269c8c0 Add packages API
2a836c1 Add dummy Package.getMainScreenshotURL() function
73a79d5 Add file upload for releases
5a9fc51 Add download button and URL
570dd51 Move package templates to subfolder
811e830 added me
8ff5315 Remove access to repos from Github scope
0385590 Use consistent quotes
9ddc29e Fix work queue permissions check
517b8c9 Fix link in README.md
dc31a98 Add list of packages to profile
87d7b14 Add packages page to list all types
4e870bd Add basic search to package list
8a8b0e5 Improve permission checking in work queue
7169170 Improve empty text on work queue
12d58d3 Add more information to approval view
e5de870 Add work queue
aed805d Add new package approval
49a2a91 Add package validation
a8edae1 Add package creation
5cc49f2 Add package release editing and approving
32ac602 Add redirect to full user URL
bbb46ce Fix incomplete datetime being stored in releases, order releases by date
d039474 Add create release page
596f725 Add package releases
623ca3d Simplify PackageType
363f9d8 Add not joined rank
73f24ad Add permission validation to Package.checkPerm()
bd58f9b Clean up permissions code
0fae3a6 Fix bug with PackageType to name form
9fc71a5 User profile: fix typo, add rank
dad980c Add suggest changes button
775850b Implement permissions properly
5a3764f Add edit package
7c628ca Add example info
d3484d9 Add more details to package page
d17535f Fix menu order
07a9b79 Check type and author in package details
bc88027 Add package types
ae60058 Rename mod to package, add README
358fc4e Add package list and package view
84f123a Fix profile page
7d20c49 Add Github login
7f4faf2 Update dependencies
366a230 Initial commit