这是indexloc提供的服务,不要输入任何密码
Skip to content

ignore certain headers from the request when calling the webhook (close #260) #261

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

Merged
merged 3 commits into from
Aug 6, 2018
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .circleci/ciignore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ if [[ ! -a "$ROOT/.ciignore" ]]; then
fi

# Check CIRCLE_COMPARE_URL first and if its not set, check for diff with master.

if [[ ! -z "$CIRCLE_COMPARE_URL" ]]; then
# CIRCLE_COMPARE_URL is not empty, use it to get the diff
COMMIT_RANGE=$(echo $CIRCLE_COMPARE_URL | sed 's:^.*/compare/::g')
if [[ $CIRCLE_COMPARE_URL = *"commit"* ]]; then
COMMIT_RANGE=$(echo $CIRCLE_COMPARE_URL | sed 's:^.*/commit/::g')~1
else
COMMIT_RANGE=$(echo $CIRCLE_COMPARE_URL | sed 's:^.*/compare/::g')
fi
echo "Diff: $COMMIT_RANGE"
changes="$(git diff $COMMIT_RANGE --name-only)"
else
Expand Down
6 changes: 5 additions & 1 deletion server/src-lib/Hasura/Server/Auth.hs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ userInfoFromWebhook logger manager urlT reqHeaders = do
throw500 "Internal Server Error"

filteredHeaders = flip filter reqHeaders $ \(n, _) ->
n `notElem` ["Content-Length", "User-Agent", "Host", "Origin", "Referer"]
n `notElem` [ "Content-Length", "Content-MD5", "User-Agent", "Host"
, "Origin", "Referer" , "Accept", "Accept-Encoding"
, "Accept-Language", "Accept-Datetime"
, "Cache-Control", "Connection", "DNT"
]

accessKeyHeader :: T.Text
accessKeyHeader = "x-hasura-access-key"
Expand Down