Reset requestOptions after form submission is complete #112
Reference in New Issue
Block a user
Delete Branch "master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When submitting a form, subsequent requests keep the
requestMethodandrequestPayloads; this causes the form to "autosubmit" with the previous values when you load it again.This PR resets the request options so that subsequent non-form requests go back to using the defaults.
You're right; there's no reason that needs to persist.
But I think it would be even better not to use
this.optionsat all, and instead create a newoptionsobject right away.@BehindTheMath good call. I've gone ahead and made that change.
Great!
Can you do the same for attach-link.js?
I didn't see anywhere else in the code
requestOptionswould have been modified from its default of{}, so I moved its instantiation to the top to be consistent withattach-form.js.The
**glob wasn't working for me (and it doesn't seem to be working properly on TravisCI either since only 40 tests were run instead of 77), so I changed this to be explicit.This change should not be necessary. The
**glob should include everything under./tests/, including all subdirectories.I thought so too, but it doesn't seem to be working even on TravisCI:
From what I've read,
globstarneeds to be explicitly enabled so it may not be portable.if that can help, glob not wrapped in string can fail. I would recommend you try using
"tests": "tape -r ./tests/setup.js \"./tests/**/*.js\"",(can fail depending on the bash used to run the command)
Confirmed that wrapping the arg in quotes works on both my local environment (OS X) and TravisCI. Updated.
LGTM.
@MoOx Any other issues?
LGTM. Generally speaking, don't wait for my input. You are the users here (as I already said, I currently don't use this lib anywhere atm).
I have seen enough the last few days to trust you @BehindTheMath! Do not hesitate to move forward without my approval unless you really want it (I am still watching the project and follow each issue/pr - I may use this lib soon :))
Ok, thank you!