Skip to content
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

Proxy mangles URL strings in JSON #2016

Open
2 of 10 tasks
Thomaash opened this issue Feb 24, 2023 · 0 comments
Open
2 of 10 tasks

Proxy mangles URL strings in JSON #2016

Thomaash opened this issue Feb 24, 2023 · 0 comments
Labels

Comments

@Thomaash
Copy link

Issue details

The URL rewriting sometimes eats a backslash following the URL, causing syntax errors.

Steps to reproduce/test case

Add the following to an HTML file served from 127.0.0.1:8887:

<script>
  console.log("[\"baseUrl\",\"127.0.0.1:8887\"]");
  console.log("[\"baseUrl\",\"//127.0.0.1:8887\"]");
  console.log("[\"baseUrl\",\"http://127.0.0.1:8887\"]");
</script>

and on localhost:3000 you get:

<script>
  console.log("[\"baseUrl\",\"//localhost:3000"]");
  console.log("[\"baseUrl\",\"//localhost:3000\"]");
  console.log("[\"baseUrl\",\"//localhost:3000"]");
</script>

Please specify which version of Browsersync, node and npm you're running

  • Browsersync [ 2.27.11 ]
  • Node [ 18.5.0 ]
  • Npm [ 8.12.1 ]

Affected platforms

  • linux
  • windows
  • OS X
  • freebsd
  • solaris
  • other (please specify which)

Browsersync use-case

  • API
  • Gulp
  • Grunt
  • CLI

for all other use-cases, (gulp, grunt etc), please show us exactly how you're using Browsersync

import { create as createBrowserSync } from "browser-sync";

const browserSync = createBrowserSync();

browserSync.init({
  host: "127.0.0.1",
  port: 3000,
  proxy: "127.0.0.1:8887",
});
@shakyShane shakyShane added the bug label Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants