Skip to content

Conversation

kwilt
Copy link
Contributor

@kwilt kwilt commented Feb 6, 2025

Supporting pull request for prometheus/snmp_exporter#1335

Maybe this sucks, idk. I'm getting out of my comfort zone with this pull request lol. But I gave it a shot anyway. 😬

This is my attempt at moving a good chunk of the routing for the exporter into the landing page's codebase. In theory this could make a more cohesive experience across exporters and allow for easier development as most of the routing work is now done by using the LandingConfig struct.

…serving the pprof endpoints accessible on the landing page

Signed-off-by: kwilt <[email protected]>
// Ensure Path component of ExternalURL is formatted without trailing slashes,
// contains a leading slash, and is not empty
pathPrefix := strings.TrimRight(parsedExternalURL.Path, "/")
if pathPrefix != "" && !strings.HasPrefix(pathPrefix, "/") {

Check warning

Code scanning / CodeQL

Bad redirect check Medium

This is a check that
this value
, which flows into a
redirect
, has a leading slash, but not that it does not have '/' or '' in its second position.
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.

1 participant