From 2dc80b95cfb073ab60c8581937dbef774de34cc6 Mon Sep 17 00:00:00 2001 From: Alexander Sheiko Date: Mon, 15 Jun 2020 11:42:12 +0300 Subject: [PATCH] Fix get profile --- profile.go | 1 + profile_test.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/profile.go b/profile.go index c3ec5e7..a70e77c 100644 --- a/profile.go +++ b/profile.go @@ -37,6 +37,7 @@ func GetProfile(username string) (Profile, error) { } req.Header.Set("Accept-Language", "en-US") + req.Header.Set("X-Requested-With", "XMLHttpRequest") resp, err := http.DefaultClient.Do(req) if resp == nil { diff --git a/profile_test.go b/profile_test.go index adaf2e0..6bb3756 100644 --- a/profile_test.go +++ b/profile_test.go @@ -12,8 +12,8 @@ func TestGetProfile(t *testing.T) { loc := time.FixedZone("UTC", 0) joined := time.Date(2007, 02, 20, 6, 35, 0, 0, loc) sample := Profile{ - Avatar: "https://pbs.twimg.com/profile_images/1111729635610382336/_65QFl7B_400x400.png", - Biography: "What’s happening?!", + Avatar: "https://pbs.twimg.com/profile_images/1270500941498912768/W-80pLvu_400x400.jpg", + Biography: "Black queer lives matter.\nBlack trans lives matter.\n#BlackLivesMatter", Birthday: "March 21", Joined: &joined, Location: "Everywhere",