mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 22:30:41 +08:00
Lowercase ENS name search query
Since ENS names go through a UTS46 normalisation process case-folds labels before hashing them. So we shouldn't be ENS querying uppercase names. Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
+10
-2
@@ -53,9 +53,14 @@ export async function resolve(
|
||||
results.projects.push(...projects);
|
||||
|
||||
// ========= ENS Names =========
|
||||
const normalizedQuery = q.toLowerCase();
|
||||
let profile: Profile | null;
|
||||
try {
|
||||
profile = await Profile.get(q, ProfileType.Minimal, config);
|
||||
profile = await Profile.get(
|
||||
normalizedQuery,
|
||||
ProfileType.Minimal,
|
||||
config,
|
||||
);
|
||||
} catch (e) {
|
||||
profile = null;
|
||||
}
|
||||
@@ -71,7 +76,10 @@ export async function resolve(
|
||||
let profiles: Profile[];
|
||||
try {
|
||||
profiles = await Profile.getMulti(
|
||||
[`${q}.${config.registrar.domain}`, `${q}.eth`],
|
||||
[
|
||||
`${normalizedQuery}.${config.registrar.domain}`,
|
||||
`${normalizedQuery}.eth`,
|
||||
],
|
||||
config,
|
||||
);
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user