Print

Print


@abh3 requested changes on this pull request.

Almost there!

> @@ -661,6 +661,15 @@ bool XrdHttpReq::Redir(XrdXrootd::Bridge::Context &info, //!< the result context
   else
     redirdest = "Location: http://";
   
+  // port < 0 signals switch to full URL
+  if (port < 0)
+  {
+    if (string(hname).find("file://") != string::npos)

Well, that is not a safe comparison as you may get a match even though it's not a file-local URL. You should do this

if (strncmp(hname, "file://", 7) == 0)

that's better than the "std" alternative 
if (string(hname).rfind("file://", 0) == 0)
as you don't have to allocate memory to do this simple comparison.  

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/xrootd/xrootd/pull/1242#pullrequestreview-447658618

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1