The browser padlock is important. It is critical for e-commerce and other applications that depend on HTTPS for sending sensitive information securely. Unfortunately many sites, even major retailers have trouble keeping that browser padlock green.
On my teams I've seen it happen over and over. You release a web application that uses SSL. At launch time there is manual QA to ensure the browser padlock is green. All good. 6 months later, the padlock is broken becuase somebody misconfigured the webfonts, or the YouTubes, etc.
The problem here is that you have a manual QA step! Rack-Padlock is a tool I wrote to remove that manual step. Building this was soo awesome! I got to read the CSP specification. My rack-fu has gotten pretty good. And my final solution is crazy easy to use!
Check out the sample application, or just drop it into your own Rails app.
Saturday, February 9, 2013
Tuesday, January 22, 2013
Tips for Easy UTF-8 Ruby Adventuring
Getting that search box working in Esperanto? Cherokee? Pull on your wading boots because your walking into deep waters. I can't make you an expert in UTF-8 but I can recommend that you know the following stuff before you venture forth:
- Make sure your DB is configured to support UTF-8. Configuration is DB specific so please see documentation for your respective DB.
- Make sure your Ruby source code supports UTF-8. You might be surprised to find out that ruby 1.9 encodes your source code as US-ASCII by default. Take some time to learn about the magic encoding comment.
- Make sure your regexes support UTF-8. Use posix character properties instead of standard ASCII character classes like \w \s \d
- Upcase and downcase won't work for UTF-8 strings, but there is a gem for that! Checkout unicode_utils
- If you want to compare unicode strings in MySQL, have a look at collation in their documentation and know the difference between: utf8_general_ci and utf8_bin. You might be surprised how loose the default matching is.
Subscribe to:
Posts (Atom)