Skip to content
/ Teapot Public

πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–β€¦

License

Notifications You must be signed in to change notification settings

0xLeif/Teapot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Teapot

Serving tea to users in need

What is Teapot?

Teapot is a Vapor and Swift framework that uses the status code 418, also known as "I'm a teapot". The Vapor framework contains a middleware that will return the status code of 418, unless there is a header named "isTea". The Swift framework contains extensions on URLRequest that add the required header needed.

Why use Teapot?

Teapot is a joke. Use it at your own discresion.

Teapot is a simple framework to add a simple level of obscurity to your Vapor server. That is all.

Security by obscurity alone is discouraged and not recommended by standards bodies. The National Institute of Standards and Technology (NIST) in the United States sometimes recommends against this practice: "System security should not depend on the secrecy of the implementation or its components." source

Basic usage

Vapor

import Teapot

Swift Client

import SwiftTea

Examples

Vapor Middleware

app
    .grouped(TeapotMiddleware())
    .get { _ -> String in "πŸ«–" }

try app.testable().test(.GET, "") { res in
    XCTAssertEqual(res.status, .imATeapot)
    XCTAssertNotEqual(res.body.string, "πŸ«–")
}

let headers: HTTPHeaders = ["isTea": "true"]

try app.testable().test(.GET, "", headers: headers) { res in
    XCTAssertNotEqual(res.status, .imATeapot)
    XCTAssertEqual(res.body.string, "πŸ«–")
}

Swift URLRequest

let url: URL = ...

let teaRequest = URLRequest.tea(url: url)

// or

let existingRequest: URLRequest = ...

let teaRequest = existingRequest.teaRequest

About

πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–πŸ«–β€¦

Topics

Resources

License

Stars

Watchers

Forks

Languages