Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
MFE runtime configuration in dev mode was not working properly prior to this. It would always end up querying the
example.com
site configuration. With this change, we force the request origin to always be the LMS host and port, as opposed to something likeapps.local.edly.io:2001
, which would trip up the Django site detection.Reproducing and testing
To reproduce (and test) the problem:
git clone https://github.com/openedx/frontend-app-learner-dashboard
tutor mounts add ./frontend-app-learner-dashboard
tutor dev launch
. (This should rebuild the appropriate images.)local.edly.io:8000
entry, add an override for the dashboard such as:To test the fix, check out this branch, save configuration, (
tutor config save
), rebuild the learner dashboard dev image withtutor images build learner-dashboard-dev
, and restart the dev environment. You should then be able to see the "BOGUS" entry.Further information
For reference on
changeOrigin
, see https://webpack.js.org/configuration/dev-server/#devserverproxy and https://github.com/chimurai/http-proxy-middleware?tab=readme-ov-file#http-proxy-options.