Skip to content

Conversation

cuducos
Copy link
Contributor

@cuducos cuducos commented Apr 14, 2025

The logic used to say if the string does not contain https:// or https:// — it should be and instead because full URLs would have one or the other ; )

(Plus minor change to use .starts_with instead of just contains)

@rochacbruno rochacbruno merged commit 4b14084 into rochacbruno:main Apr 14, 2025
3 checks passed
@@ -16,7 +16,7 @@ pub fn generate_rss(
) -> Result<(), String> {
let date_format = "%a, %d %b %Y %H:%M:%S GMT"; // Loose RFC-822 format

let feed_url = if !config.url.contains("http://") || !config.url.contains("https://") {
let feed_url = if !config.url.starts_with("http://") && !config.url.starts_with("https://") {
format!("http://{}", &config.url)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we use https:// instead of http:// or choose one of them based on a configuration?

@cuducos cuducos mentioned this pull request May 26, 2025
@cuducos cuducos deleted the fix-feed-url branch May 27, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants