Skip to content

Conversation

@koba04
Copy link
Contributor

@koba04 koba04 commented Mar 9, 2017

What kind of change does this PR introduce?

a bugfix

Did you add or update the examples/?

No

Summary

Currently, webpack-dev-server mutates the proxy options, which is a cause of bug when the proxy options share a same option object.

For an instance, the following option creates different results after this PR.

  • A proxy option
const proxyTarget = {
    target: "http://localhost:9000"
};
proxy: {
    "/proxy1": proxyTarget,
    "/proxy2": proxyTarget,
}
  • Before this PR
[ { target: 'http://localhost:9000',
    context: '/proxy2',
    logLevel: 'warn' },
  { target: 'http://localhost:9000',
    context: '/proxy2',
    logLevel: 'warn' } ]
  • After this PR
[ { target: 'http://localhost:9000',
    context: '/proxy1',
    logLevel: 'warn' },
  { target: 'http://localhost:9000',
    context: '/proxy2',
    logLevel: 'warn' } ]

I think it should not override the context value.

Does this PR introduce a breaking change?

Maybe not. it is a bug fix.

Other information

@codecov
Copy link

codecov bot commented Mar 9, 2017

Codecov Report

Merging #836 into master will not change coverage.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master     #836   +/-   ##
=======================================
  Coverage   72.72%   72.72%           
=======================================
  Files           4        4           
  Lines         407      407           
  Branches      119      119           
=======================================
  Hits          296      296           
  Misses        111      111
Impacted Files Coverage Δ
lib/Server.js 82.65% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 42cd23c...a2283e6. Read the comment docs.

@SpaceK33z SpaceK33z merged commit 1dc9461 into webpack:master Mar 9, 2017
@SpaceK33z
Copy link
Member

Thanks again!!

@koba04
Copy link
Contributor Author

koba04 commented Mar 9, 2017

Thank you!

@koba04 koba04 deleted the fix-sharing-a-proxy-option branch March 9, 2017 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants