mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-27 00:55:57 +03:00
[GH-ISSUE #1629] [Scripting] Support both request.comment and response.comment #1622
Labels
No labels
Discussion
Feature request
In Progress...
Plugins
Waiting response
Windows
Windows
bug
duplicate
enhancement
feature
good first issue
iOS
macOS 10.11
question
wontfix
✅ Done
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Proxyman#1622
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Originally created by @gabrielmaldi on GitHub (May 7, 2023).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1629
Originally assigned to: @NghiaTranUIT on GitHub.
Description
Currently, you can only use either request.comment in onRequest or response.comment in onResponse.
If you set both, response.comment overrides request.comment.
In addition, both request.comment and response.comment are undefined in onResponse (having previously set request.comment to a value in onRequest). So you cannot do something like
response.comment = request.comment + "\n" + "Something else".It would also be great if both request and response got their own comment instance, and both had panels (right now only Request has a comment panel):
If this is not desired, I would settle with request.comment or response.comment having their value (which was set in onRequest) available in onResponse, to be able to concatenate with another value and this be shown in the Request > Comment panel.
Why this feature/change is important?
I'm working on a product which has custom encryption and compression of request and response body and query params. It uses it's own algorithm and dynamic keys. So it's an ideal use case for a Proxyman Addon that automatically decrypts and uncompresses requests and responses and displays the JSON body and query params in the Comment panel. Otherwise, doing this manually for each request is really cumbersome.
Thanks!
@NghiaTranUIT commented on GitHub (May 8, 2023):
Thanks for the detailed feedback @gabrielmaldi 👍
I prefer the simple solution, by fixing the
request.commenton theonResponse(), so you can use this code:I'm going to fix it and send you a Beta now 👍
Just wondering: Are you able to decrypt your custom encryption by the Scripting tool?
@NghiaTranUIT commented on GitHub (May 8, 2023):
@gabrielmaldi you can try this Beta build: https://download.proxyman.io/beta/Proxyman_4.7.1_Fix_comment_on_the_Scripting.dmg
request.commentis undefined in theonResponse()func.https://user-images.githubusercontent.com/5878421/236726480-69f72b41-bca8-4f7c-be7c-a7574230c4b8.mp4
@gabrielmaldi commented on GitHub (May 8, 2023):
Wow, thank you for the swift answer!
I tried the beta build and it works perfectly.
One minor detail I noticed is that if the row is selected before the server returns the response, only the request comment is rendered in the panel; and for it to refresh and include the response comment, I need to select another row and come back.
But I guess this is probably a tricky UI update pattern that may have trade-offs, so not gonna be picky 😊. This would also be solved by having a dedicated response comment panel, but I understand this is a bigger feature request and I'm fine with the current simple solution.
Can't tell you just now because I haven't yet tried, but I'm confident it should work. I will use MD5, AES, Buffer and pako (zlib), some of which you already make available to scripting.
Thanks!
@NghiaTranUIT commented on GitHub (May 8, 2023):
Thanks for sharing the bug 👍
Let me know if you need some help because the JavascriptCore (Apple) doesn't ship all features from NodeJS.
@gabrielmaldi commented on GitHub (Nov 17, 2025):
This is now covered by Custom Previewer Tabs. Thanks!