You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by pr...@apache.org on 2016/07/18 05:28:24 UTC
zeppelin git commit: ZEPPELIN-1168 Add http header X-Requested-By in
post request to Livy for CSRF protection
Repository: zeppelin
Updated Branches:
refs/heads/master 89b71ca03 -> 24a7e1810
ZEPPELIN-1168 Add http header X-Requested-By in post request to Livy for CSRF protection
### What is this PR for?
Add http header X-Requested-By in post request to Livy for CSRF protection
### What type of PR is it?
Improvement
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1168
### How should this be tested?
enable csrf_protection on livy and check for "CSRF protection is enabled" message in the Livy logs. If this header is missing Livy server will send the following error message "Missing Required Header for CSRF protection."
### Questions:
* Does the licenses files need update? n/a
* Is there breaking changes for older versions? n/a
* Does this needs documentation? n/a
Author: Renjith Kamath <re...@gmail.com>
Closes #1181 from r-kamath/ZEPPELIN-1168 and squashes the following commits:
3bae7a5 [Renjith Kamath] ZEPPELIN-1168 Add http header X-Requested-By in post request to Livy Interpreter
Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/24a7e181
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/24a7e181
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/24a7e181
Branch: refs/heads/master
Commit: 24a7e1810f16dece1fe7534218a61d83fe93ee6e
Parents: 89b71ca
Author: Renjith Kamath <re...@gmail.com>
Authored: Wed Jul 13 16:41:21 2016 +0530
Committer: Prabhjyot Singh <pr...@gmail.com>
Committed: Mon Jul 18 10:58:18 2016 +0530
----------------------------------------------------------------------
livy/src/main/java/org/apache/zeppelin/livy/LivyHelper.java | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/24a7e181/livy/src/main/java/org/apache/zeppelin/livy/LivyHelper.java
----------------------------------------------------------------------
diff --git a/livy/src/main/java/org/apache/zeppelin/livy/LivyHelper.java b/livy/src/main/java/org/apache/zeppelin/livy/LivyHelper.java
index fb83003..f84765d 100644
--- a/livy/src/main/java/org/apache/zeppelin/livy/LivyHelper.java
+++ b/livy/src/main/java/org/apache/zeppelin/livy/LivyHelper.java
@@ -348,6 +348,7 @@ public class LivyHelper {
RestTemplate restTemplate = getRestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/json");
+ headers.add("X-Requested-By", "zeppelin");
ResponseEntity<String> response = null;
if (method.equals("POST")) {
HttpEntity<String> entity = new HttpEntity<String>(jsonData, headers);