make link codes unaware of upper and lower case
This commit is contained in:
+2
-2
@@ -18,8 +18,8 @@ actix-identity = "0.3"
|
||||
actix-rt = "1.1"
|
||||
actix-slog = "0.2"
|
||||
actix-web = "3"
|
||||
actix-web-static-files = "3.0"
|
||||
actix-files = "0.5.0"
|
||||
actix-web-static-files = "3"
|
||||
actix-files = "0.5"
|
||||
anyhow = "1.0"
|
||||
argonautica = "0.2"
|
||||
clap = "2.33"
|
||||
|
||||
@@ -231,9 +231,13 @@ impl LinkDbOperations<Self> for Link {
|
||||
code: &str,
|
||||
server_config: &ServerConfig,
|
||||
) -> Result<Self, ServerError> {
|
||||
let link = sqlx::query_as!(Self, "Select * from links where code = ? ", code)
|
||||
.fetch_one(&server_config.db_pool)
|
||||
.await;
|
||||
let link = sqlx::query_as!(
|
||||
Self,
|
||||
"Select * from links where code = ? COLLATE NOCASE",
|
||||
code
|
||||
)
|
||||
.fetch_one(&server_config.db_pool)
|
||||
.await;
|
||||
tracing::info!("Found link: {:?}", &link);
|
||||
link.map_err(ServerError::Database)
|
||||
}
|
||||
|
||||
+2
-2
@@ -86,8 +86,8 @@ pub async fn wasm_app(config: web::Data<crate::ServerConfig>) -> Result<HttpResp
|
||||
<body>
|
||||
<section id="app"><div class="lds-ellipsis">Loading: <div></div><div></div><div></div><div></div></div></section>
|
||||
<script type="module">
|
||||
import init from '/app/pkg/package.js';
|
||||
init('/app/pkg/package_bg.wasm');
|
||||
import init from '/app/pkg/app.js';
|
||||
init('/app/pkg/app_bg.wasm');
|
||||
</script>
|
||||
</body>
|
||||
</html>"#,
|
||||
|
||||
Reference in New Issue
Block a user