awkward / Ocarina

A library to get metadata and Open Graph information from URLs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting time out when fetching information for DHL url tracking

thierrybucco opened this issue · comments

Fixed it.
It was because of our custom user-agent.
I added a public user-agent property on OcarinaManager.

ocarina.userAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"

The setting of the user agent is an awesome addition.

When this library was created we wanted to be friendly to server admins and identify ourselves as a bot, that's why we changed the user agent.

But I can still think of use cases where you want to keep the original user agent or set your own, so this is great :)

I've reviewed the PR and left some feedback, once you've implemented the feedback I will check it again and merge it of everything looks ok :)