Skip to content

Commit 1f03fe2

Browse files
committed
refactor: Append /json to IP lookup URL
1 parent a26ff5c commit 1f03fe2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ipinfoWrapper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export default class IPinfoWrapper {
157157
return data;
158158
}
159159

160-
return this.fetchApi(ip).then(async (response) => {
160+
return this.fetchApi(`${ip}/json`).then(async (response) => {
161161
const ipinfo = (await response.json()) as IPinfo;
162162

163163
/* convert country code to full country name */
@@ -237,7 +237,7 @@ export default class IPinfoWrapper {
237237
filter: boolean
238238
): Promise<any> {
239239
return this.fetchApi(`batch${filter ? "?filter=1" : ""}`, {
240-
// Accept: "application/json",
240+
Accept: "application/json",
241241
headers: {
242242
"Content-Type": "application/json"
243243
},

0 commit comments

Comments
 (0)