Skip to content

Commit 81834e7

Browse files
authored
In the cases where url are sent in headers we dont must to sanitize it. (#735)
* In the cases where url are sent in headers we dont must to sanitize it. Issue: 103288 * For the moment we are not going to sanitize header values because it's taking a lot of problem.
1 parent 03c8f6b commit 81834e7

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

gxweb/src/main/java/com/genexus/internet/HttpAjaxContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ public void redirect_impl(String url, IGXWindow win) {
13581358

13591359
if (isSpaRequest(true)) {
13601360
pushUrlSessionStorage();
1361-
getResponse().setHeader(GX_SPA_REDIRECT_URL, url + popLvlParm);
1361+
getResponse().setHeader(GX_SPA_REDIRECT_URL, url + popLvlParm, false);
13621362
sendCacheHeaders();
13631363
} else {
13641364
redirect_http(url + popLvlParm);

java/src/main/java/com/genexus/webpanels/HttpContextWeb.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@ protected void redirect_http(String url) {
13181318
} else {
13191319
pushUrlSessionStorage();
13201320
if (useCustomRedirect()) {
1321-
getResponse().setHeader("Location", url);
1321+
getResponse().setHeader("Location", url, false);
13221322
getRequest().setAttribute("gx_webcall_method", "customredirect");
13231323
getResponse().setStatus(HttpServletResponse.getSC_MOVED_TEMPORARILY());
13241324
} else {
@@ -1336,7 +1336,7 @@ private void doRedirect(String url) throws IOException {
13361336
getRequest().setAttribute("gx_webcall_method", "redirect");
13371337
// getResponse().sendRedirect(url); No retornamos 302 sino 301, debido al SEO.
13381338
response.setStatus(HttpServletResponse.getSC_MOVED_PERMANENTLY());
1339-
response.setHeader("Location", url);
1339+
response.setHeader("Location", url, false);
13401340
sendCacheHeaders();
13411341
}
13421342

wrapperjakarta/src/main/java/com/genexus/servlet/http/HttpServletResponse.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ public void setHeader(String name, String value) {
2828
}
2929

3030
public void setHeader(String name, String value, boolean sanitize) {
31-
if (sanitize)
32-
resp.setHeader(name, CommonUtil.Sanitize(value, CommonUtil.HTTP_HEADER_WHITELIST));
33-
else
31+
//if (sanitize)
32+
// resp.setHeader(name, CommonUtil.Sanitize(value, CommonUtil.HTTP_HEADER_WHITELIST));
33+
//else
3434
resp.setHeader(name, value);
3535
}
3636

wrapperjavax/src/main/java/com/genexus/servlet/http/HttpServletResponse.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ public void setHeader(String name, String value) {
2828
}
2929

3030
public void setHeader(String name, String value, boolean sanitize) {
31-
if (sanitize)
32-
resp.setHeader(name, CommonUtil.Sanitize(value, CommonUtil.HTTP_HEADER_WHITELIST));
33-
else
31+
//if (sanitize)
32+
// resp.setHeader(name, CommonUtil.Sanitize(value, CommonUtil.HTTP_HEADER_WHITELIST));
33+
//else
3434
resp.setHeader(name, value);
3535
}
3636

0 commit comments

Comments
 (0)