Improving URL sanitation.

This commit is contained in:
EduardoRiesco 2018-09-26 18:22:40 +00:00 committed by SantiagoBragagnolo
parent 82a8e42119
commit cb79fb2fc8
1 changed files with 1 additions and 1 deletions

View File

@ -93,7 +93,7 @@ GrafoscopioUtils class >> sanitize: url [
modUrl := url.
[modUrl asString endsWith: ' ']
whileTrue: [ modUrl := modUrl copyFrom: 1 to: (modUrl size - 1) ].
(url asString beginsWith: 'http://')
(url asString beginsWith: 'http') "http or https"
ifFalse: [ sanitized := ('http://', modUrl) asUrl ]
ifTrue: [ sanitized := modUrl asUrl ].
^ sanitized