node-vault icon indicating copy to clipboard operation
node-vault copied to clipboard

Endpoint with trailing slash

Open wes-novack opened this issue 5 years ago • 5 comments

Hello! For the VAULT_ADDR endpoint value, if the caller provides a value that includes a trailing slash, eg; http://127.0.0.1:8200/, the library currently does not handle it well.

We can see that the full uri is constructed here: https://github.com/kr1sp1n/node-vault/blob/70097269d35a58bb560b5290190093def96c87b1/src/index.js#L91

...with a trailing slash concatenated into the uri after the client.endpoint.

We would like to submit a PR that addresses the problem with a client.endpoint value that includes a trailing slash, by automatically handling it by removing that trailing slash from the endpoint value.

Thoughts/comments/discussion appreciated.

wes-novack avatar Jan 05 '21 19:01 wes-novack

@kr1sp1n any thoughts on this?

GoFightNguyen avatar Jan 14 '21 17:01 GoFightNguyen

I had to normalize all my URLs before I handed them off. Would be great if the package did that for us.

Aenima4six2 avatar Feb 16 '21 19:02 Aenima4six2

Hey @wes-novack! sry for the (very) late response :X

Do you mind creating this PR so I can merge it?

aviadhahami avatar Nov 10 '22 17:11 aviadhahami

@aviadhahami This issue is addressed in #176

GoFightNguyen avatar Nov 13 '22 17:11 GoFightNguyen

@GoFightNguyen thx! just saw the PR was updated but codecov & travis are stuk

I'll await @kr1sp1n to give me perms to force rebuild and merge 👍 thx for the help :)

aviadhahami avatar Nov 13 '22 18:11 aviadhahami