Skip to content

Commit

Permalink
Handle the Credential header for COPY requests.
Browse files Browse the repository at this point in the history
We do not support any Credential header value except `none`.
Instead of ignoring this header altogether, we should fail the
transfer if the client has requested a mode we do not support.
  • Loading branch information
bbockelm committed Jan 31, 2019
1 parent 2a90e61 commit 1673310
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/XrdTpc/XrdTpcTPC.cc
Expand Up @@ -87,7 +87,14 @@ int TPCHandler::ProcessReq(XrdHttpExtReq &req) {
if (req.verb == "OPTIONS") {
return ProcessOptionsReq(req);
}
auto header = req.headers.find("Source");
auto header = req.headers.find("Credential");
if (header != req.headers.end()) {
if (header->second != "none") {
m_log.Emsg("ProcessReq", "COPY requested an unsupported credential type: ", header->second.c_str());
return req.SendSimpleResp(400, NULL, NULL, "COPY requestd an unsupported Credential type", 0);
}
}
header = req.headers.find("Source");
if (header != req.headers.end()) {
std::string src = PrepareURL(header->second);
m_log.Emsg("ProcessReq", "Pull request from", src.c_str());
Expand Down

0 comments on commit 1673310

Please sign in to comment.