Skip to content

Commit

Permalink
fix: 修正 http hander 字段
Browse files Browse the repository at this point in the history
  • Loading branch information
roojay520 committed Sep 30, 2020
1 parent 6f60ad3 commit 57190e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/google-translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function _detect(text: string, options: QueryOption = {}) {
Bob.$http.post({
url: `https://translate.google.${tld}/translate_a/single?${querystring.stringify(query)}`,
timeout,
headers: { 'User-Agent': Bob.util.userAgent },
header: { 'User-Agent': Bob.util.userAgent },
body: { q: text },
}),
);
Expand Down Expand Up @@ -109,7 +109,7 @@ async function _translate(text: string, options: QueryOption = {}) {
Bob.$http.post({
url: `https://translate.google.${tld}/translate_a/single?${querystring.stringify(data)}`,
timeout,
headers: {
header: {
'User-Agent': Bob.util.userAgent,
},
body: { q: text },
Expand Down
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ declare namespace Bob {
interface HttpRequestConfig {
url: string;
method?: HttpMethod;
headers?: any;
header?: any;
params?: any;
body?: any;
files?: HttpRequestFiles;
Expand Down

0 comments on commit 57190e0

Please sign in to comment.