Skip to content

Commit de7bd37

Browse files
Api-User-Agent header
1 parent 79a1e59 commit de7bd37

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/MwApi.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { deputyVersion } from './DeputyVersion';
2+
13
/**
24
*
35
*/
@@ -11,6 +13,13 @@ export default class MwApi {
1113
*/
1214
static get action(): mw.Api {
1315
return this._action ?? ( this._action = new mw.Api( {
16+
ajax: {
17+
headers: {
18+
'Api-User-Agent': `Deputy/${
19+
deputyVersion
20+
} (https://w.wiki/5k$q; User:Chlod; [email protected])`
21+
}
22+
},
1423
parameters: {
1524
format: 'json',
1625
formatversion: 2,

0 commit comments

Comments
 (0)