Tidy
This commit is contained in:
parent
cd2686a5b2
commit
fec542ee62
|
@ -23,11 +23,6 @@ type uploadResult struct {
|
|||
size int64
|
||||
}
|
||||
|
||||
type readResult struct {
|
||||
n int
|
||||
err error
|
||||
}
|
||||
|
||||
const (
|
||||
targetPartSizeBytes = 5 * 1024 * 1024 // 5MB
|
||||
readBufferSizeBytes = 32_768 // 32Kb
|
||||
|
|
|
@ -27,7 +27,7 @@ func init() {
|
|||
const (
|
||||
// ts-proto generates code that automatically retries for a subset of gRPC
|
||||
// response codes. To avoid invoking this behaviour, default to returning a
|
||||
// Cancelled code. Later,
|
||||
// Cancelled code for now.
|
||||
// See https://github.com/stephenh/ts-proto/blob/459b94f5b2988d58d186461332e888c3e511603a/src/generate-grpc-web.ts#L293
|
||||
// and https://github.com/stephenh/ts-proto/pull/131.
|
||||
defaultResponseCode = codes.Canceled
|
||||
|
@ -146,7 +146,7 @@ func Start(options Options) error {
|
|||
|
||||
pbMediaSet.RegisterMediaSetServiceServer(grpcServer, &mediaSetServiceController{mediaSetService: fetchMediaSetService})
|
||||
|
||||
// TODO: proper CORS support
|
||||
// TODO: configure CORS
|
||||
grpcWebServer := grpcweb.WrapServer(grpcServer, grpcweb.WithOriginFunc(func(string) bool { return true }))
|
||||
handler := func(w http.ResponseWriter, r *http.Request) {
|
||||
grpcWebServer.ServeHTTP(w, r)
|
||||
|
|
Loading…
Reference in New Issue