-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add https option to prependUrl util #47312
Conversation
Size Change: +25 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
Flaky tests detected in 1dc407e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3966426233
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why aren't we making https default?
Because I didn't want to introduce a change to the default return value that could have ripple effects outside of this change. No other reason. |
Is there any way to get it to always be "CURRENT_PROTOCOL"? |
What does that value represent? I don't follow. I'm working on an alternative PR to this one which I will push up shortly which simply uses https by default. |
Somehow just use whatever the current protocol is in the browser. If the user is on http use http if the user is on https use https. |
Ah I see. Nonetheless, I think these functions should be idempotent. I don't think they should change behaviour depending on the environment in which they being run. |
I agree with this sentiment FWIW. I laid some suggestions in #47467 (comment) and I think given the context here, it might be best to introduce |
100%. Should have thought of that. I think
is better. @getdave is the above suggestion very annoying 🙏🏻 ? |
Nope let's go with that. I'll raise a PR 👍 |
Follow up #47648 |
What?
Add ability to use the
https
protocol when consuming theprependHttp
util.Part of #46244
Why?
Needed for #46244
How?
Add option. Add tests.
Testing Instructions
Run
npm run test:unit packages/url/src/test/index.js
Testing Instructions for Keyboard
Screenshots or screencast