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

Extend the urlencoding function to /r and /n #1068

Merged
merged 1 commit into from
Oct 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/XrdHttp/XrdHttpReq.cc
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,10 @@ bool XrdHttpReq::Redir(XrdXrootd::Bridge::Context &info, //!< the result context

// Here we put back the opaque info, if any
if (vardata) {
char *newvardata = quote(vardata);
redirdest += "?&";
redirdest += vardata;
redirdest += newvardata;
free(newvardata);
}

// Shall we put also the opaque data of the request? Maybe not
Expand Down
8 changes: 8 additions & 0 deletions src/XrdHttp/XrdHttpUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,14 @@ char *quote(const char *str) {
strcpy(r + j, "%2F");
j += 3;
break;
case '\n':
strcpy(r + j, "%0C");
j += 3;
break;
case '\r':
strcpy(r + j, "%0A");
j += 3;
break;
default:
r[j++] = c;
}
Expand Down