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

feat(all): remove X-Requested-With header from HTTP requests #13550

Merged
merged 8 commits into from May 20, 2023

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Aug 30, 2022

Removing "twitter workaround" from the SDK that and removed fixed X-Requested-With header.
If needed user can still add it but having it as a default causes more errors.

Old info for Twitter: https://jira-archive.titaniumsdk.com/TIMOB/TIMOB-729

Test
run and check for the returned output

var url = "https://httpbin.org/post";
var client = Ti.Network.createHTTPClient({
	onload: function(e) {
		Ti.API.info(this.responseText);
	}
});
client.open("POST", url);
client.send();

X-Requested-With": "XMLHttpRequest", shouldn't be visible after this PR

Requested in Slack: paySmart3D checks for "ajax requests" and didn't work when the header is there.
Feedback from slack: Removing that line made the API call successful.

@m1ga m1ga marked this pull request as ready for review August 30, 2022 17:56
@m1ga m1ga changed the title feat(android): add ignoreXRequestedWith to HTTPClient feat(all): add ignoreXRequestedWith to HTTPClient May 13, 2023
@m1ga m1ga changed the title feat(all): add ignoreXRequestedWith to HTTPClient feat(all): remove X-Requested-With header from HTTP requests May 13, 2023
@cb1kenobi cb1kenobi merged commit 67ba7a6 into master May 20, 2023
5 checks passed
narbs pushed a commit to narbs/titanium_mobile that referenced this pull request Jun 7, 2023
@m1ga m1ga deleted the androidRequestHeader branch September 23, 2023 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants