Skip to content

Commit

Permalink
fix: minor backports
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-guggisberg committed May 9, 2023
1 parent 8629fcf commit 2bb8531
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
- [Cache](#cache)
- [Advanced Usage Examples](#advanced-usage-examples)
- [HTTP/2 Server Push](#http2-server-push)
- [Use h2c (http2 cleartext w/prior-knowledge) protocol](#use-h2c-http2-cleartext-wprior-knowledge-protocol)
- [Force HTTP/1(.1) protocol](#force-http11-protocol)
- [HTTP/1.1 Keep-Alive](#http11-keep-alive)
- [Extract Set-Cookie Header](#extract-set-cookie-header)
Expand Down Expand Up @@ -439,6 +440,15 @@ You can however add a listener which will be notified on every pushed (and cache
console.log(`Http version: ${resp.httpVersion}`);
```

### Use h2c (http2 cleartext w/prior-knowledge) protocol

```javascript
const { fetch } = require('@adobe/fetch');

const resp = await fetch('http2://nghttp2.org');
console.log(`Http version: ${resp.httpVersion}`);
```

### Force HTTP/1(.1) protocol

```javascript
Expand Down
1 change: 1 addition & 0 deletions src/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export class Response extends Body {
readonly httpVersion: string;
readonly decoded: boolean;
headers: Headers;
clone(): Response;

// non-spec extensions
/**
Expand Down

0 comments on commit 2bb8531

Please sign in to comment.