Skip to content
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

Decode HTTP basic auth header and generate cURL command with user and password #108

Merged
merged 1 commit into from
Jan 21, 2014
Merged

Conversation

jandillmann
Copy link
Contributor

Currently, the generated cURL command for examples that include basic HTTP authentication contains the raw authentication header.

curl "http://api.example.org/" -d '' -X GET \
  -H "Authorization: Basic dXNlckBleGFtcGxlLm9yZzpwYXNzd29yZA=="

In my opinion, the command is more helpful the way a user would enter it into the terminal, e.g. using cURL's -u or --user option.

This pull request detects a HTTP basic auth header, decodes it, and generates a corresponding cURL command.

curl "http://api.example.org/" -d '' -X GET \
  -u user@example.org:password

@oestrich
Copy link
Contributor

This looks awesome. Thanks!

oestrich added a commit that referenced this pull request Jan 21, 2014
Decode HTTP basic auth header and generate cURL command with user and password
@oestrich oestrich merged commit 539ebe4 into zipmark:master Jan 21, 2014
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.

2 participants