mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-26 08:35:53 +03:00
[GH-ISSUE #792] Keep headers from original response in map local #786
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#786
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 @lkipke on GitHub (Feb 17, 2021).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/792
Originally assigned to: @NghiaTranUIT on GitHub.
Proxyman version?
Proxyman 2.18.0
macOS Version?
mac 10.14.6
Steps to reproduce
Expected behavior
Since my map local rule only rewrites the body, I would expect that all of the original response headers are kept on the response (except probably
Content-Length). Currently, this prevents CORS-enabled requests, because theAccess-Control-Allow-Originheader is removed from the response.I think that I can work around this by using the scripting tool, but it'd be nice to have the map local tool support it as well 😄 Also, this is a great product -- love it so far!
@NghiaTranUIT commented on GitHub (Feb 18, 2021):
Hi. Thanks for your kind words 😄
Unfortunately, Map Local doesn't make any real requests to your server, so Proxyman doesn't know the real Response from your server. We intentionally implement by this way because it's possible to do Mock API. For instance, you can call a fake Endpoint (e.g. www.fakedomain.com/api) and provide a response with Map Local tool.
There are several ways to achieve this:
1. Create Map Local rule from Right-Context Menu
Access-Control-Allow-Originheader in the response2. Define Map Local as an entire HTTP Message (includes Headers and Body)
3. Using Scripting
Feel free to let me know if you struggle in some point 😄
@lkipke commented on GitHub (Feb 18, 2021):
Awesome, thanks for the help! 😄