Git Product home page Git Product logo

Comments (4)

gambol99 avatar gambol99 commented on June 9, 2024

@mattes agreed! ... we should validate each one ... I'll raise a PR

from go-marathon.

timoreimann avatar timoreimann commented on June 9, 2024

@gambol99 Are you working on this one? Otherwise, I'd like to take a stab.

from go-marathon.

timoreimann avatar timoreimann commented on June 9, 2024

After a bit of investigation, I don't think we need to make any significant changes. Specifically,

  1. The parsed Host field is already split on comma, so we're not using the comma-separated list directly. Parsing the marathonURL passed to newCluster still makes sense though since the schema needs to be (and is) verified.
  2. Applying url.Parse()/url.ParseRequestURI() on each host doesn't really add a lot of value: The main job of the methods is to parse the schema and host, retrieve authorization data, and do unescaping. We already do the first one on marathonURL and don't really care about the latter two as the contained hosts will eventually be used in a request to Marathon as-is. (Side note: To me it seems that Golang's parsing functions are mainly for parsing URLs structurally, not validation.)

The only thing I'd recommend at this stage is to check each host for emptiness and add tests. WDYT?

from go-marathon.

timoreimann avatar timoreimann commented on June 9, 2024

I put together a PR based on my observations/assumptions pro-actively. Happy to discuss. :)

from go-marathon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.