Git Product home page Git Product logo

lyli's People

Contributors

felixbade avatar ilarikuoppala avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ilarikuoppala

lyli's Issues

Respond with 400 or 409 when submitted shortening form is not accepted.

At the moment Lyli always returns 200 to shortening form submissions. However, HTTP error codes would be more informative.

409 Conflict should be used when the submitted suffix is already in use.

This response is sent when a request conflicts with the current state of the server.

400 Bad Request should be used when the suffix isn’t allowed, or the long URL is malformed.

The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

The client should not repeat this request without modification.

Add automated regression tests

Even simple automated tests would help catch major problems possibly happening when code or dependencies are updated. I suggest at least the following tests:

Test that the front page opens normally with a correct response code.
Shorten a link, test that it works twice, delete the link, test that the link does not work.
Test that a non-existing link opens the correct page for non-existing links.

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.