Skip to content

Commit 9229753

Browse files
committed
Pass auth in header not in uri
1 parent 83fadb6 commit 9229753

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gh-md-toc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ gh_toc_md2html() {
5858
TOKEN="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/token.txt"
5959
fi
6060
if [ -f "$TOKEN" ]; then
61-
URL="$URL?access_token=$(cat $TOKEN)"
61+
AUTH_HEADER=("-H" "Authorization: token $(cat $TOKEN)")
6262
fi
6363
# echo $URL 1>&2
6464
OUTPUT="$(curl -s --user-agent "$gh_user_agent" \
65-
--data-binary @"$gh_file_md" -H "Content-Type:text/plain" \
65+
--data-binary @"$gh_file_md" -H "Content-Type:text/plain" "${AUTH_HEADER[@]}" \
6666
$URL)"
6767

6868
if [ "$?" != "0" ]; then

0 commit comments

Comments
 (0)