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

implement http authorization #21

Closed
Kanezoh opened this issue Nov 22, 2021 · 1 comment
Closed

implement http authorization #21

Kanezoh opened this issue Nov 22, 2021 · 1 comment

Comments

@Kanezoh
Copy link
Owner

Kanezoh commented Nov 22, 2021

want to cover http authorizations, at least basic auth first.

The original mechanize uses #add_auth to add authorization info to agent and saves it in AuthStore.

https://github.com/sparklemotion/mechanize/blob/4a0dfe57123ff78066d72fe1106db3abc547cb65/lib/mechanize/http/agent.rb#L208

In Crystal, there is #basic_auth method to add authorization info to http client.
https://crystal-lang.org/api/1.2.2/HTTP/Client.html#basic_auth(username,password):Nil-instance-method

It is an instance method, but now mechanize.cr uses class methods to send http request like HTTP::Client.get~, so we may need to rewrite it to use instance method like client.get~

@Kanezoh
Copy link
Owner Author

Kanezoh commented Jan 6, 2022

#22

@Kanezoh Kanezoh closed this as completed Jan 6, 2022
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

No branches or pull requests

1 participant