mirror of
https://github.com/denoland/deno.git
synced 2024-11-26 16:09:27 -05:00
Fix jsdoc in std/http/server.ts (#3284)
This commit is contained in:
parent
25c276055b
commit
709cb3c9ba
1 changed files with 17 additions and 14 deletions
|
@ -228,9 +228,11 @@ function fixLength(req: ServerRequest): void {
|
|||
}
|
||||
}
|
||||
|
||||
// ParseHTTPVersion parses a HTTP version string.
|
||||
// "HTTP/1.0" returns (1, 0, true).
|
||||
// Ported from https://github.com/golang/go/blob/f5c43b9/src/net/http/request.go#L766-L792
|
||||
/**
|
||||
* ParseHTTPVersion parses a HTTP version string.
|
||||
* "HTTP/1.0" returns (1, 0, true).
|
||||
* Ported from https://github.com/golang/go/blob/f5c43b9/src/net/http/request.go#L766-L792
|
||||
*/
|
||||
export function parseHTTPVersion(vers: string): [number, number] {
|
||||
switch (vers) {
|
||||
case "HTTP/1.1":
|
||||
|
@ -450,8 +452,6 @@ export function serveTLS(options: HTTPSOptions): Server {
|
|||
|
||||
/**
|
||||
* Create an HTTPS server with given options and request handler
|
||||
* @param options Server configuration
|
||||
* @param handler Request handler
|
||||
*
|
||||
* const body = new TextEncoder().encode("Hello HTTPS");
|
||||
* const options = {
|
||||
|
@ -463,6 +463,9 @@ export function serveTLS(options: HTTPSOptions): Server {
|
|||
* listenAndServeTLS(options, (req) => {
|
||||
* req.respond({ body });
|
||||
* });
|
||||
*
|
||||
* @param options Server configuration
|
||||
* @param handler Request handler
|
||||
*/
|
||||
export async function listenAndServeTLS(
|
||||
options: HTTPSOptions,
|
||||
|
|
Loading…
Reference in a new issue