Opened 8 years ago
Closed 8 years ago
#44764 closed defect (bug) (fixed)
Missing slash between protocol and domain in fallback of wp.api.utils.getRootUrl()
| Reported by: | ocean90 | Owned by: | kadamwhite |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.0 |
| Component: | REST API | Version: | 4.7 |
| Severity: | normal | Keywords: | good-first-bug has-patch commit |
| Cc: | Focuses: | javascript, rest-api |
Description
If window.location.origin isn't set, getRootUrl() falls back to window.location.protocol, a single slash and window.location.host. The result of this is an URL with one missing slash between the protocol and the domain because window.location.protocol only contains the protocol and the colon. Example output: http:/localhost:3000/
Attachments (2)
Change History (10)
#2
@
8 years ago
- Keywords needs-unit-tests added
- Milestone Future Release → 5.0
- Owner set to
- Status new → accepted
This ticket was mentioned in Slack in #core-restapi by kadamwhite. View the logs.
8 years ago
#4
@
8 years ago
Refreshed patch to apply cleanly on the develop repo. Looks good, @abdullahramzan, thank you for tackling this!
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Slash Fix