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(api) new function: set hostname #3203

Merged
merged 2 commits into from
Aug 2, 2024

Conversation

airween
Copy link
Member

@airween airween commented Aug 1, 2024

what

This PR adds a new feature which creates and sets the inside m_requestHostName variable, what used to fill the [hostname] in the log.

The PR provides a new API method: Transaction::setHostName(const std::string& hostname). If the method is not called during the transaction, then the variable contains the server IP address (no changes). Only the application controls this method.

There is a C function too: msc_set_request_hostname(const unsigned char * hostname);

why

Currently, [hostname] contains the IP address of the server, which is not useful at all.

references

See discussion #3200.

@airween airween requested a review from marcstern August 1, 2024 20:44
Copy link

sonarcloud bot commented Aug 1, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
C Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@airween airween merged commit 97c3d15 into owasp-modsecurity:v3/master Aug 2, 2024
48 of 49 checks passed
@marcstern marcstern added the 3.x Related to ModSecurity version 3.x label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Related to ModSecurity version 3.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants