Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'X-Requested-By' header to requests #597

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ import * as detailingFuncs from './modules/details/legacy';
action: "map_info",
uh: user.unique_hash,
last_read_journal_entry_id: lastReadJournalEntryId,
'X-Requested-By': `MHCT/${mhhh_version}`,
};
$.post('https://www.mousehuntgame.com/managers/ajax/users/treasuremap_v2.php', payload, null, 'json')
.done(data => {
Expand Down Expand Up @@ -295,6 +296,7 @@ import * as detailingFuncs from './modules/details/legacy';
hg_is_ajax: 1,
last_read_journal_entry_id: lastReadJournalEntryId,
uh: user.unique_hash,
'X-Requested-By': `MHCT/${mhhh_version}`,
},
dataType: "json",
}).done(userRqResponse => {
Expand Down Expand Up @@ -705,9 +707,9 @@ import * as detailingFuncs from './modules/details/legacy';
hunter_id_hash,
entry_timestamp: final_message.entry_timestamp,
extension_version: mhhh_version,
'X-Requested-By': `MHCT/${mhhh_version}`,
};


// Get UUID
$.post(base_domain_url + "/uuid.php", basic_info).done(data => {
if (data) {
Expand Down Expand Up @@ -1322,7 +1324,12 @@ import * as detailingFuncs from './modules/details/legacy';
// Form data directly in URL to distinguish it from a profile "King's Crowns" tab click
const crownUrl = `https://www.mousehuntgame.com/managers/ajax/pages/page.php?page_class=HunterProfile&page_arguments%5Btab%5D=kings_crowns&page_arguments%5Bsub_tab%5D=false&page_arguments%5Bsnuid%5D=${profile_snuid}&uh=${user.unique_hash}`;

$.post(crownUrl, "sn=Hitgrab&hg_is_ajax=1", null, "json")
const payload = {
sn: 'Hitgrab',
hg_is_ajax: 1,
'X-Requested-By': `MHCT/${mhhh_version}`,
};
$.post(crownUrl, payload, null, "json")
.fail(err => {
logger.debug(`Crown query failed for snuid=${profile_snuid}`, err);
});
Expand Down