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

fix #24 #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

anzanipaolodev
Copy link

Here I implemented a simple solution.
An if statement checks which protocol is used by using URI["scheme"] and set the appropriate flags.

HINTERNET hRequest = HttpOpenRequestA(hConnect, request.Method.c_str(), URI["path"].c_str(), NULL , NULL, NULL, INTERNET_FLAG_SECURE | INTERNET_FLAG_NO_AUTO_REDIRECT, 0);

// Set flags based on request protocol
DWORD dwFlags = 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you can initialize dwFlags with INTERNET_FLAG_NO_AUTO_REDIRECT, then do a bitwise or-equals (|= INTERNET_FLAG_SECURE) in the if statement and remove the redundant else if statement.

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