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

Headers problem #84

Closed
albabosh opened this issue Sep 20, 2018 · 3 comments
Closed

Headers problem #84

albabosh opened this issue Sep 20, 2018 · 3 comments

Comments

@albabosh
Copy link

albabosh commented Sep 20, 2018

I take headers from the request & put them into curl (the upstream requires basic auth), but the upstream returns 401, despite the login&password is absolutely correct (direct connect from client to upstream works correct, if client connects to upstrem through EEL - the upstream returns 401)

@boriwo
Copy link
Collaborator

boriwo commented Sep 20, 2018

I just tried this example successfully:

{{curl('GET','https://jigsaw.w3.org/HTTP/Basic/','','{"Authorization":"Basic Z3Vlc3Q6Z3Vlc3Q="}')}}

This one has eel perform basic auth against this public test endpoint: https://jigsaw.w3.org/HTTP/

Note that headers is the 4th parameter of curl() and has to be json encoded.

You might also find the built-in test endpoint http:///test/ast useful for debugging eel expressions as you construct them.

@albabosh
Copy link
Author

{{curl('POST', '{{prop('node_api')}}', '', '{"Authorization":"Basic bXVsdGljaGFpbnJwYzpIOHJ5U1NwNU5lRFVWc3VB1856cFlSSEFFcWl1cUFzZzk2Q0JZMw=="}')}} gives error "Message": "invalid json in config file config-handlers/tenant1/default.json", what is wrong here?

@albabosh
Copy link
Author

I soved it. Should look like this {{curl('GET','https://jigsaw.w3.org/HTTP/Basic/','','{\"Authorization\":\"Basic Z3Vlc3Q6Z3Vlc3Q="}')}}

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

2 participants