Giter Club home page Giter Club logo

httpcustomhouse's Introduction

«It's not a bug it's a feature»
If the feature works in an unintended way, it's a bug.

httpcustomhouse's People

Contributors

ariary avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

httpcustomhouse's Issues

Feature: request in browser

Have a tool to perform request in browser

cat raw | http2browser
>>> url to paste in browsser

Launch a local server. The server performs the request when reached and echo output

Take into account that all href or redirection need to be be prefixed by the real url

(maybe if path differs from /[random_number] you perform the request to the url with the same path)

  • Proxy to URL with headers
  • 1 first request with header meta modifying url

Feature: request in browser with cookie & headers

Propose a mechanism that enable -B option with cookie cause in certain case script,image are only available with specific cookie or others.

Also, if we click on a link it will not proceed the request with original cookie.

To make it works, use a proxy that will forward all request to the end server (with original Headers and same path) and then forward back the response.

cf proxyHandler in cmd/httpclient/main.go

Feature: follow code 302

With an option -L enable use to follow redirect

  • Find Location header (The address itself can be either absolute or relative)
  • Search for Set-Cookie header to perform the redirect request with

by default perform request w/ same cookie

Extra Notes

https://everything.curl.dev/http/redirects

example of response:

HTTP/1.1 302 Found
Location: /admin
Set-Cookie: session=frferfreferqferferfgerfe; Secure; HttpOnly; SameSite=None
Connection: close
Content-Length: 0

How to make Curl follow redirects?
To follow redirect with Curl, use the -L or --location command-line option. This flag tells Curl to resend the request to the new address. When you send a POST request, and the server responds with one of the codes 301, 302, or 303, Curl will make the subsequent request using the GET method. For other 300x status codes, Curl will resend the subsequent request using the same unmodified HTTP method. This behavior can be changed using one of the --post301, --post302, or --post303 flags. When authentication is used, Curl only sends its credentials to the first host. If Curl goes to a different host when redirecting, it will not provide user credentials to the new host (you can change this behavior with the --location-trust flag). To limit the number of following redirects, you can use the --max-redirs command-line option.

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.