Skip to content

Add Logic For Rewriting URLs in JSON Response for Proxy #351

@GoPro16

Description

@GoPro16

🚀 Feature request

Current Behavior

Any JSON response that comes back with contains a URL that points to the targetHost will not work if clicked via some Link component on an app because it will not be relative to localhost when developing.

Desired Behavior

The proxy should intercept the response before it reaches the UI, modify the URLs, if any exist, and then send it to the UI.

Suggested Solution

node-http-proxy-json looks to update this however, its not modifying the content-length which is why we had to revert #314

Example

With targetHost of http://www.helloworld.com

{
   "hello": "http://www.helloworld.com/test/123"
}

Should get modified to:

{
   "hello": "http://localhost:3000/test/123"
}

Once we can get the content-length updated it should work for all types of API responses.

Additional context

#350

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions