Skip to content

Relative URLs Sometimes Break Resource Loading in Proxy #1

Description

@Mepoify

Problem:

Our Node.js proxy (using Express and http-proxy-middleware) correctly forwards requests but fails when handling relative resource URLs (images, CSS, and scripts).

For example, an image tag like <img src="/header.png"> gets requested as just: /header.png (incorrect) instead of: anothersite.com/header.png (correct).

This breaks styles and assets on proxied pages.

Steps to Reproduce

1. Set up the proxy with the code from repos latest and currently only existing version beta .6
2. Load a website with relative URLs through the proxy.
3. Observe broken images, styles, and scripts.

Proposed Solution

All relative URLs should be converted to absolute URLs from the target domain.
Example: <img src="/header.png"><img src="http://anothersite.com/header.png">

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions