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 support for more generic HTTP prefixes #22

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

bbockelm
Copy link
Collaborator

Built on top of #21; merge that first.

Do not force the HTTP plugin to have a prefix that starts with the
hostname.  Instead, make it so you can cut an arbitrary prefix off
the incoming path and prepend it with an arbitrary URL base.
Comment on lines 120 to +129

if( this->http_host_name.empty() ) {
m_log.Emsg("Config", "httpserver.host_name not specified");
return false;
}
if( this->http_host_url.empty() ) {
m_log.Emsg("Config", "httpserver.host_url not specified");
return false;
if (m_url_base.empty()) {
if (http_host_name.empty()) {
m_log.Emsg("Config", "httpserver.host_name not specified; this or httpserver.url_base are required");
return false;
}
if (http_host_url.empty()) {
m_log.Emsg("Config", "httpserver.host_url not specified; this or httpserver.url_base are required");
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

[lint] reported by reviewdog 🐶

Suggested change
if( this->http_host_name.empty() ) {
m_log.Emsg("Config", "httpserver.host_name not specified");
return false;
}
if( this->http_host_url.empty() ) {
m_log.Emsg("Config", "httpserver.host_url not specified");
return false;
if (m_url_base.empty()) {
if (http_host_name.empty()) {
m_log.Emsg("Config", "httpserver.host_name not specified; this or httpserver.url_base are required");
return false;
}
if (http_host_url.empty()) {
m_log.Emsg("Config", "httpserver.host_url not specified; this or httpserver.url_base are required");
return false;
}
value = temporary;
if (!handle_required_config(attribute, "httpserver.host_name", value,
http_host_name) ||
!handle_required_config(attribute, "httpserver.host_url", value,
http_host_url) ||
!handle_required_config(attribute, "httpserver.url_base", value,
m_url_base) ||
!handle_required_config(attribute, "httpserver.storage_prefix", value,
m_storage_prefix)) {
Config.Close();
return false;

if (http_host_url.empty()) {
m_log.Emsg("Config", "httpserver.host_url not specified; this or httpserver.url_base are required");
return false;
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

[lint] reported by reviewdog 🐶

Suggested change
}

Copy link
Member

@jhiemstrawisc jhiemstrawisc left a comment

Choose a reason for hiding this comment

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

LGTM

@jhiemstrawisc jhiemstrawisc merged commit a0eb944 into PelicanPlatform:main Mar 26, 2024
2 checks passed
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.

2 participants