-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Allow header values to be selected from selector
#184
Comments
My preference for design on this would be to add an additional field to the
Treat header as an object
Pros
Cons
Specify header and treat it as a string
Pros
Cons
ImplementationFor either design, the work involved would be roughly:
Other ThoughtsI'm not sure if it was you @Sammo98 or someone else who commented about this on Reddit, but I believe the original use case was to be able to operate on cookies. Using this design you could get at a returned cookie response, by nesting this chain inside a shell command that parses the cookie. That would be very clunky though so I 100% would like to have first class cookie support in Slumber, I just don't think it needs to be an explicit goal of this ticket. |
@LucasPickering Thanks for the response, it was me on Reddit as well, probably should have given the context of wanting to grab the cookie. Nonetheless I can see this as a useful extension to slumber for certain systems that may want to store headers. Take for instance grabbing a CSRF token (I may be wrong about this being in the headers, maybe first class cookie support would solve this). Whatever the case, thank you for the pointers, I'm happy to take a crack at this myself if that works? |
@Sammo98 Yeah go for it. And CSRF is typically sent via the |
Linked an initial basic attempt at this, it is working but still need to add tests, will try and get to that later. Please let me know if any obvious issues. (Note, this would be of my first OSS contributions so apologies if something looks awry!) |
This allows the user to chain values from a response header rather than the body. Closes LucasPickering#184
This allows the user to chain values from a response header rather than the body. Closes LucasPickering#184
This allows the user to chain values from a response header rather than the body. Closes #184
[1.1.0] - 2024-05-05 Added - Add `section` field to `!request` chain values, to allow chaining response headers rather than body ([#184](LucasPickering/slumber#184)) - Add action to save response body to file ([#183](LucasPickering/slumber#183)) - Add `theme` field to the config, to configure colors ([#193](LucasPickering/slumber#193)) - [See docs](https://slumber.lucaspickering.me/book/api/configuration/theme.html) for more info - Add `stdin` option to command chains ([#190](LucasPickering/slumber#190)) Changed - Reduce UI latency under certain scenarios - Previously some actions would feel laggy because of an inherent 250ms delay in processing some events - Search parent directories for collection file ([#194](LucasPickering/slumber#194)) - Use thicker borders for selected pane and modals - Change default TUI colors to blue and yellow Fixed - Fix Slumber going into zombie mode and CPU spiking to 100% under certain closure scenarios ([#136](LucasPickering/slumber#136)) - Fix historical request/response no loading on first render ([#199](LucasPickering/slumber#199))
It would be very useful to be able to select header values within
chains
.E.g. (taking the example from the docs)
Either enable
selector
to be able to access header values or something akin toheader_selector
which allows for this to happen.The text was updated successfully, but these errors were encountered: