Giter Site home page Giter Site logo

gneto's People

Contributors

pgorman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gneto's Issues

URL escaping

Thanks for this very useful software - I use it to read Gemini capsules on a Kindle (by adding a custom CSS). There appears to be an issue with proxying links with escaped URL parameters, e.g. click on any topic here via gneto:

gemini://tobykurien.com/cgi-bin/mailing_list.py

The topic doesn't display as the parameters aren't passed correctly (perhaps something to do with the escaped ?). I noticed a similar issue with Vulpes proxy, although Mozz.us proxy works.

Escape/encode and Unescape/decode queries properly

Gemini does queries slightly differently than Go's stdlib can provide. Use these funcs instead, which are included in go-gemini and the other go-gemini.

// QueryEscape provides URL query escaping in a way that follows the Gemini spec.
// It is the same as url.PathEscape, but it also replaces the +, because Gemini
// requires percent-escaping for queries.
func QueryEscape(query string) string {
    return strings.ReplaceAll(url.PathEscape(query), "+", "%2B")
}

// QueryUnescape is the same as url.PathUnescape
func QueryUnescape(query string) (string, error) {
    return url.PathUnescape(query)
}

The reason this is required is because Gemini does not allow pluses to be used for spaces in queries. They always represent a literal plus sign.

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.