GithubHelp home page GithubHelp logo

Follow redirects if possible about gistlog HOT 2 CLOSED

tighten avatar tighten commented on April 28, 2024
Follow redirects if possible

from gistlog.

Comments (2)

greydnls avatar greydnls commented on April 28, 2024

<3 thanks

According to this, it's not possible. :( https://help.github.com/articles/what-happens-when-i-change-my-username/

from gistlog.

ghostwriter avatar ghostwriter commented on April 28, 2024
  • extract gist_id from https://gist.github.com/kayladnls/e5bff1a7c1f85d83c37f5294b9fe8e03
  • fetch gists by gists_id -> https://api.github.com/gists/e5bff1a7c1f85d83c37f5294b9fe8e03
  • check if the $username !== $gistlog->author in GistsController.php#L49
  • redirect to the gist with the correct/updated username.
  • provide a message to readers that the url has been updated/changed and to update their bookmarks or links.
if ($username !== $gistlog->author) {
    return redirect()->action(
        'GistsController@show', [
            'username' => $gistlog->author,
            'gistId' => $gistlog->id
        ]
    )->with('status', "The resource you've requested $username/$gistId has moved to a new location. Please update your bookmarks and/or links to reflect the new location of this resource.");
}

cc: @mattstauffer @greydnls

from gistlog.

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.