From 4b7bf9d778046c96a0d699700a208cdc0ab6076a Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 24 Mar 2018 23:10:13 +0000 Subject: [PATCH] Fix wrong download URL when serving behind reverse proxy --- app/views/packages.py | 4 ++-- log.txt | 55 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 log.txt diff --git a/app/views/packages.py b/app/views/packages.py index 6cace90c..864a35fa 100644 --- a/app/views/packages.py +++ b/app/views/packages.py @@ -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] diff --git a/log.txt b/log.txt new file mode 100644 index 00000000..b10c5704 --- /dev/null +++ b/log.txt @@ -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