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 "Unset Headers" keyword #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mrehanabbasi
Copy link

Add the keyword "Unset Headers" to unset existing headers.

@asimell
Copy link
Contributor

asimell commented Jul 4, 2022

Thanks for the PR @mrehanabbasi ! Could you please open this PR to the Eficode fork of this repo? We'll collect a release there and then make a release PR here.

It might be only me, but I think unset headers in a bit out of line with most of Robot Framework's other keywords and I think it would be better if the name was remove headers. However, this is possibly only my preference, so it's not that big of a deal.

Also, it's unclear from the keyword documentation whether something like Unset Header Authorization will work. I think it would be good if the header is removable with or without the value. See #130 for details.

For debugging purposes, it could be also useful if the keyword (optionally) logged headers that were not deleted or even throws an error depending on the use case, e.g

My Test Case
    Unset Headers    non-existant
-->
[Warn]    Unable to remove header 'non-existant'

@mrehanabbasi
Copy link
Author

Hey @asimell.

It might be only me, but I think unset headers in a bit out of line with most of Robot Framework's other keywords and I think it would be better if the name was remove headers. However, this is possibly only my preference, so it's not that big of a deal.

It is okay either way for me. I can make the changes if you want.

Also, it's unclear from the keyword documentation whether something like Unset Header Authorization will work. I think it would be good if the header is removable with or without the value. See #130 for details.

It won't work with the existing code. I do plan on updating it soon as it is more developer-friendly.

For debugging purposes, it could be also useful if the keyword (optionally) logged headers that were not deleted or even throws an error depending on the use case, e.g

My Test Case
    Unset Headers    non-existant
-->
[Warn]    Unable to remove header 'non-existant'

That is a nice suggestion. I'll add this as well.

Could you please open this PR to the Eficode fork of this repo? We'll collect a release there and then make a release PR here.

I will do that after making the necessary changes suggested above.

@asimell
Copy link
Contributor

asimell commented Jul 5, 2022

It won't work with the existing code. I do plan on updating it soon as it is more developer-friendly.

Could you elaborate on this a bit? What do you mean by "more developer-friendly"?

Could you also add acceptance tests for this new keyword (atest/headers.robot) to verify that it actually works?

@mrehanabbasi
Copy link
Author

Could you elaborate on this a bit? What do you mean by "more developer-friendly"?

I meant that adding only header names instead of the whole values will be more "developer-friendly".

Could you also add acceptance tests for this new keyword (atest/headers.robot) to verify that it actually works?

Will try.

@asimell
Copy link
Contributor

asimell commented Jul 6, 2022

Ah, sorry, I misread your initial comment. I read it as "the current code is not developer-friendly, so I will not do it". 😅 Please, carry on.

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.

None yet

2 participants