Heya Everyone
I hope everyone is enjoying the week so far. It sure has been a busy one for your boy.
So, I'm going to try and keep this one short.
Just as a refresher, in my last post I talked about how I reviewed Chris' repo and filed issues and even submitted a small PR.
Well, I jumped the gun on that a bit showed initiative last week because contributing something useful was the task for this week. We were tasked with adding 2 optional features that had not been implemented yet. So naturally, I chose the feature I thought would be easiest to implement I could do since I absolutely detest python.
Going down the list and reviewing his code once again I noticed that he was using the request "get" as opposed to "head". I figured this wouldn't be much of a PR as it was fairly simple. I decided to make another feature because Chris was doing two why not. Next on my hitlist was the 300 redirection. It sounds pretty simple right?!
Well it was and it was not at the same time. I had troubles storing the URL of where you were being redirected. A quick search and I found my answer on a stackoverflow thread.
In order to store the history and allow redirecting I had to implement another request.
req2 = requests.head(test_link, allow_redirects=True)
Awesome everything worked out and redirects were now being followed. I don't know what happened when I was trying to create a PR for this feature but I had an issue with pushing my updates. Super weird... I had no idea. After a little tinkering I figured it out but it was annoying.
No comments:
Post a Comment