You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #269, we addressed the issue raised in #266 where we weren't properly lowercasing entity slugs before looking them up in the database. At the moment, we manually lowercase every entity slug (whether they are in headers or paths), but this is error-prone and should happen implicitly. @sofiaritz shared some thoughts about how to do this cleanly:
About how should we approach the lowercasing, I think the best way is to create a struct like LowercaseString that implements From<String> and FromStr and that can be used in the database models to ensure that everything that goes into the database is lowercased. That would require implementing the Serialize and Deserialize traits manually, but I think we already do that somewhere and this isn't really complex to implement tbh.
We should also implement the Defer trait to automagically convert LowercaseString into a &str, this usually isn't a best practice (generally this is a really bad idea because implicit conversions are mostly undesired), but the String type does this which means that we probably should do it too.
The text was updated successfully, but these errors were encountered:
In #269, we addressed the issue raised in #266 where we weren't properly lowercasing entity slugs before looking them up in the database. At the moment, we manually lowercase every entity slug (whether they are in headers or paths), but this is error-prone and should happen implicitly. @sofiaritz shared some thoughts about how to do this cleanly:
The text was updated successfully, but these errors were encountered: