Fixing downloading of documents from the Web.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2017-09-25 09:43:59 +00:00
parent 9153efbbba
commit 8f509a0133

View File

@ -68,9 +68,9 @@ GrafoscopioUtils class >> sanitize: url [
operations that rely on sane and well formed urls don't throw error messages." operations that rely on sane and well formed urls don't throw error messages."
| sanitized modUrl | | sanitized modUrl |
modUrl := url. modUrl := url.
[modUrl endsWith: ' '] [modUrl asString endsWith: ' ']
whileTrue: [ modUrl := modUrl copyFrom: 1 to: (modUrl size - 1) ]. whileTrue: [ modUrl := modUrl copyFrom: 1 to: (modUrl size - 1) ].
(url beginsWith: 'http://') (url asString beginsWith: 'http://')
ifFalse: [ sanitized := ('http://', modUrl) asUrl ] ifFalse: [ sanitized := ('http://', modUrl) asUrl ]
ifTrue: [ sanitized := modUrl asUrl ]. ifTrue: [ sanitized := modUrl asUrl ].
^ sanitized ^ sanitized