Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions rust/agama-server/src/web/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ pub async fn login(
pub struct LoginFromQueryParams {
/// Token to use for authentication.
token: String,
/// Requested locale
lang: String,
/// Optional requested locale
lang: Option<String>,
}

#[utoipa::path(get, path = "/login", responses(
Expand All @@ -126,8 +126,10 @@ pub async fn login_from_query(
let mut target = String::from("/");

// keep the "lang" URL query if it was present in the original request
if !&params.lang.is_empty() {
target.push_str(format!("?lang={}", params.lang).as_str());
if let Some(lang) = params.lang {
if !lang.is_empty() {
target.push_str(format!("?lang={}", lang).as_str());
}
}

let location = HeaderValue::from_str(target.as_str());
Expand Down
6 changes: 6 additions & 0 deletions rust/package/agama.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Feb 10 13:28:34 UTC 2025 - Ladislav Slezák <lslezak@suse.com>

- Fixup: Make the "lang" URL query optional, do not fail when it
is missing. This fixes crash on non-UEFI systems.

-------------------------------------------------------------------
Fri Feb 7 11:03:29 UTC 2025 - Ladislav Slezák <lslezak@suse.com>

Expand Down