Skip to content
This repository was archived by the owner on Jun 7, 2020. It is now read-only.

[FIX] Fix uppercase url scheme#1548

Merged
luciofm merged 2 commits intobetafrom
fix/fix-uppercase-scheme
Jul 27, 2018
Merged

[FIX] Fix uppercase url scheme#1548
luciofm merged 2 commits intobetafrom
fix/fix-uppercase-scheme

Conversation

@luciofm
Copy link
Copy Markdown
Contributor

@luciofm luciofm commented Jul 26, 2018

closes #967
closes #1546

@luciofm luciofm added this to the 2.5.1 milestone Jul 26, 2018
@luciofm luciofm self-assigned this Jul 26, 2018
private fun String.ensureScheme(): Uri? {
// check if the URL starts with a http(s) scheme
val url = if (!this.matches(Regex("^([h|H][t|T][t|T][p|P]).*"))) {
"http://$this"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the scheme is HTTPS?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just to check if the url already has a scheme... Sometimes we receive urls like "www.something.com", so we append "http://"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha! 👍

@luciofm luciofm merged commit e0e2f92 into beta Jul 27, 2018
@luciofm luciofm deleted the fix/fix-uppercase-scheme branch July 27, 2018 14:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants