16

Man! I love refactoring! 👨🏻‍💻😍
Only saved about 20 lines but it went from ugly string manipulation to beautiful JavaScript objects!

Comments
  • 0
    It really feels good when you have to go back to it later, and it makes sense / changes are easy.
  • 3
    The manual HTTP -> HTTPS conversion should really be handled on the server.

    Just add upgrade-insecure-requests to your CSP and enable HSTS.
  • 1
    @SortOfTested hahah. I get URLs as string and had to fix the in the past. Maybe not anymore...

    Now that I think about it I'm so dumb! I don't even use that part of the string! I only use the pathname! I could probably get it in a easier way other than splitting the string! 🤦🏻‍♂️ 🤦🏻‍♂️
  • 0
    No matter how many glitter you put on there, it's gonna still being JavaScript
  • 0
    @devcexx Hello Java dev
  • 1
    @theuser DONT JUDGE ME ABOUT MY PAST :(
Add Comment