Skip to content

Commit

Permalink
Remove url encoding, it was double encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromechoo committed Jan 23, 2024
1 parent 7702579 commit 9f1ea68
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def feeds():
}
except Exception as e:
flash(str(e), 'Error')
return render_template('home.html', url_encoded=quote_plus(request.args.get('url', '')), feed_detail=feed_detail, actual_rss_url=actual_rss_url)
return render_template('home.html', page_url=request.args.get('url', ''), feed_detail=feed_detail, actual_rss_url=actual_rss_url)

@app.route('/rss')
@limiter.limit("1/second", error_message='Rate limit exceeded')
Expand Down Expand Up @@ -105,7 +105,7 @@ def generate_feed(url):
fg.id(feed_url)
fg.description(feed_description)
fg.icon(feed_icon)
fg.link(href=f"https://rss.diffbot.com/rss?url={quote_plus(feed_url)}", rel='self')
fg.link(href=f"https://rss.diffbot.com/rss?url={feed_url}", rel='self')
fg.link(href=feed_url, rel='alternate')
fg.managingEditor(managingEditor="[email protected] (Jerome Choo)")
fg.docs(docs="https://rss.diffbot.com")
Expand Down
8 changes: 4 additions & 4 deletions templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@


{% if feed_detail %}
<link rel="alternate" type="application/rss+xml" title="{{ feed_detail['title'] }}" href="{{ url_for('rss', url=url_encoded) }}" />
<link rel="alternate" type="application/atom+xml" title="{{ feed_detail['title'] }}" href="{{ url_for('atom', url=url_encoded) }}" />
<link rel="alternate" type="application/rss+xml" title="{{ feed_detail['title'] }}" href="{{ url_for('rss', url=page_url) }}" />
<link rel="alternate" type="application/atom+xml" title="{{ feed_detail['title'] }}" href="{{ url_for('atom', url=page_url) }}" />
{% endif %}
{% if actual_rss_url %}
<link rel="alternate" type="application/rss+xml" title="{{ feed_detail['title'] }}" href="{{ actual_rss_url }}" />
Expand Down Expand Up @@ -75,13 +75,13 @@ <h2 class="title-font text-lg font-medium text-gray-900 mb-1">{{ feed_detail['ti
</svg>
</a>
{% endif %}
<a href="{{ url_for('rss', url=url_encoded) }}" target="_blank" class="text-amber-600 items-center font-semibold inline-flex hover:underline">RSS Feed
<a href="{{ url_for('rss', url=page_url) }}" target="_blank" class="text-amber-600 items-center font-semibold inline-flex hover:underline">RSS Feed
<svg class="w-4 h-4 ml-1" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path d="M5 12h14"></path>
<path d="M12 5l7 7-7 7"></path>
</svg>
</a>
<a href="{{ url_for('atom', url=url_encoded) }}" target="_blank" class="text-indigo-600 items-center font-semibold inline-flex hover:underline">Atom Feed
<a href="{{ url_for('atom', url=page_url) }}" target="_blank" class="text-indigo-600 items-center font-semibold inline-flex hover:underline">Atom Feed
<svg class="w-4 h-4 ml-1" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path d="M5 12h14"></path>
<path d="M12 5l7 7-7 7"></path>
Expand Down

0 comments on commit 9f1ea68

Please sign in to comment.