Skip to content

Commit 5786e27

Browse files
committed
fix: should not thrown on Windows when proxy target is an object
closes #2478
1 parent e929d48 commit 5786e27

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/@vue/cli-service/lib/util/prepareProxy.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ module.exports = function prepareProxy (proxy, appPublicFolder) {
5151
}
5252

5353
function createProxyEntry (target, usersOnProxyReq, context) {
54-
if (process.platform === 'win32') {
54+
// #2478
55+
// There're a little-known use case that the `target` field is an object rather than a string
56+
// https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/https.md
57+
if (typeof target === 'string' && process.platform === 'win32') {
5558
target = resolveLoopback(target)
5659
}
5760
return {

0 commit comments

Comments
 (0)