When submitting a form, subsequent requests keep the requestMethod and requestPayloads; 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.
When submitting a form, subsequent requests keep the `requestMethod` and `requestPayload`s; 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.options at all, and instead create a new options object right away.
You're right; there's no reason that needs to persist.
But I think it would be even better not to use `this.options` at all, and instead create a new `options` object right away.
I didn't see anywhere else in the code requestOptions would have been modified from its default of {}, so I moved its instantiation to the top to be consistent with attach-form.js.
I didn't see anywhere else in the code `requestOptions` would have been modified from its default of `{}`, so I moved its instantiation to the top to be consistent with `attach-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.
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.
From what I've read, globstar needs to be explicitly enabled so it may not be portable.
I thought so too, but it doesn't seem to be working even on TravisCI:
* Before the change, only 40 tests ran: https://travis-ci.org/MoOx/pjax/jobs/332062989
* After the change, 77 tests ran: https://travis-ci.org/MoOx/pjax/jobs/332428661
[From what I've read](https://stackoverflow.com/a/1691202), `globstar` needs to be explicitly enabled so it may not be portable.
Confirmed that wrapping the arg in quotes works on both my local environment (OS X) and TravisCI. Updated.
Confirmed that wrapping the arg in quotes works on both my local environment (OS X) and [TravisCI](https://travis-ci.org/MoOx/pjax/jobs/332473782). Updated.
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 :))
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 :))
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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!