mirror of
https://codeberg.org/superseriousbusiness/gotosocial.git
synced 2025-04-30 13:01:03 +03:00
[chore] Bump go swagger (#2871)
* bump go swagger version * bump swagger version
This commit is contained in:
parent
3a369d834a
commit
fd8a724e77
251 changed files with 10841 additions and 11896 deletions
vendor/github.com/go-openapi/runtime
14
vendor/github.com/go-openapi/runtime/request.go
generated
vendored
14
vendor/github.com/go-openapi/runtime/request.go
generated
vendored
|
@ -16,6 +16,8 @@ package runtime
|
|||
|
||||
import (
|
||||
"bufio"
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
@ -96,10 +98,16 @@ func (p *peekingReader) Read(d []byte) (int, error) {
|
|||
if p == nil {
|
||||
return 0, io.EOF
|
||||
}
|
||||
if p.underlying == nil {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
return p.underlying.Read(d)
|
||||
}
|
||||
|
||||
func (p *peekingReader) Close() error {
|
||||
if p.underlying == nil {
|
||||
return errors.New("reader already closed")
|
||||
}
|
||||
p.underlying = nil
|
||||
if p.orig != nil {
|
||||
return p.orig.Close()
|
||||
|
@ -107,9 +115,11 @@ func (p *peekingReader) Close() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// JSONRequest creates a new http request with json headers set
|
||||
// JSONRequest creates a new http request with json headers set.
|
||||
//
|
||||
// It uses context.Background.
|
||||
func JSONRequest(method, urlStr string, body io.Reader) (*http.Request, error) {
|
||||
req, err := http.NewRequest(method, urlStr, body)
|
||||
req, err := http.NewRequestWithContext(context.Background(), method, urlStr, body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue