summaryrefslogtreecommitdiffstats
path: root/debuginfod
diff options
context:
space:
mode:
authorFrank Ch. Eigler <[email protected]>2023-10-10 16:21:00 -0400
committerFrank Ch. Eigler <[email protected]>2023-10-11 14:55:40 -0400
commit25932e63bd9dc5722d8d529f46e3540112df804f (patch)
tree41c3f2f28fb714c965cd8ae11537a54dd3e6649b /debuginfod
parentace48815682214308d2f849f149250a6562c59fe (diff)
PR30962: debuginfod: full paths for X-DEBUGINFOD-FILE/ARCHIVE response headers
Previous code was inconsistent in offering basename versus full pathname for these headers. The documentation was not explicit on this issue. We now simplify by always passing full names back, and document this in the debuginfod.8 man page, along with pointers to how to use proxy front-end servers to strip them if needed. Signed-Off-By: Frank Ch. Eigler <[email protected]>
Diffstat (limited to 'debuginfod')
-rw-r--r--debuginfod/debuginfod.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
index e5322880..c11aeda1 100644
--- a/debuginfod/debuginfod.cxx
+++ b/debuginfod/debuginfod.cxx
@@ -1876,11 +1876,10 @@ handle_buildid_f_match (bool internal_req_t,
}
else
{
- std::string file = b_source0.substr(b_source0.find_last_of("/")+1, b_source0.length());
add_mhd_response_header (r, "Content-Type", "application/octet-stream");
add_mhd_response_header (r, "X-DEBUGINFOD-SIZE",
to_string(s.st_size).c_str());
- add_mhd_response_header (r, "X-DEBUGINFOD-FILE", file.c_str());
+ add_mhd_response_header (r, "X-DEBUGINFOD-FILE", b_source0.c_str());
add_mhd_last_modified (r, s.st_mtime);
if (verbose > 1)
obatched(clog) << "serving file " << b_source0 << " section=" << section << endl;
@@ -2164,14 +2163,12 @@ handle_buildid_r_match (bool internal_req_p,
}
else
{
- std::string file = b_source1.substr(b_source1.find_last_of("/")+1, b_source1.length());
add_mhd_response_header (r, "Content-Type",
"application/octet-stream");
add_mhd_response_header (r, "X-DEBUGINFOD-SIZE",
to_string(archive_entry_size(e)).c_str());
- add_mhd_response_header (r, "X-DEBUGINFOD-ARCHIVE",
- b_source0.c_str());
- add_mhd_response_header (r, "X-DEBUGINFOD-FILE", file.c_str());
+ add_mhd_response_header (r, "X-DEBUGINFOD-ARCHIVE", b_source0.c_str());
+ add_mhd_response_header (r, "X-DEBUGINFOD-FILE", b_source1.c_str());
add_mhd_last_modified (r, archive_entry_mtime(e));
if (verbose > 1)
obatched(clog) << "serving archive " << b_source0