Comments (4)
However it does work as expected in case https websites. Without https being mentioned in the input.
from mandown.
Line 10 in 93520e7
Here web.Sanitise
is changing donnie.in
to https://donnie.in
and successfully deletes https websites even when https is missing in the input.
However, it does not attempt to remove http://donnie.in
unless specifically http is used in the input.
Ideally it should try to delete both the http and https websites when the schema is not mentioned in the input.
And be specific when the input is specific.
from mandown.
Line 97 in 93520e7
The solution could lie in the fact that instead of returning a string Sanitise can return a structured form of the website.
If structured form is returned than the consumer would be able to get both the http and https version from the same call.
If structured form is returned that the caller will still need to do a line of work converting it into a string.
That can be avoided by returning two strings instead of one as being done currently.
One being the http form and the other being https form, thereby the caller would have the choice to use any or both very easily without any amount of further code.
from mandown.
Lines 88 to 89 in 93520e7
Also while at it the Sanitise
could ideally throw an error instead of an empty string, so that the caller can handle this possible error without having to check for length of the output url.
from mandown.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mandown.