Skip to content

Fix not storing cookies at first install #81

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

casssoft
Copy link

Not sure if I was doing something wrong but after

git clone [email protected]:micha/resty.git
. resty
resty HOST
GET /URL

The ~/.resty/c was not created and the cookies were not saved.
I had to create ~/.resty/c myself before the cookies were saved.

Also it looks like the previous code to create the cookie file only ran if the cookie file already exists and overwrote the host file (but not $_RESTY_HOST).

@@ -53,6 +53,7 @@ HELP
_RESTY_DATA_DIR="$_RESTY_CONF_DIR"
fi
mkdir -p "$_RESTY_CONF_DIR"
mkdir -p "$_RESTY_CONF_DIR/c"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -p is redundant or you can remove the mkdir call above. What you have now is the safest though.

@@ -130,10 +130,6 @@ HELP
local editor="$_RESTY_EDITOR"
if [[ "POST PUT TRACE PATCH DELETE" =~ $method ]]; then local hasbody; hasbody="yes" ;fi

if [ -d "$cookies" ] ; then # retrieve cookie
Copy link

@pkeller pkeller Jul 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is something not right here: why test whether the directory $cookies exists, and then do mkdir -p $cookies if it does?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants