mirror of
https://github.com/pgsty/minio.git
synced 2026-08-10 00:03:29 +03:00
web: Add more data for jsonrpc responses. (#3296)
This change adds more richer error response
for JSON-RPC by interpreting object layer
errors to corresponding meaningful errors
for the web browser.
```go
&json2.Error{
Message: "Bucket Name Invalid, Only lowercase letters, full stops, and numbers are allowed.",
}
```
Additionally this patch also allows PresignedGetObject()
to take expiry parameter to have variable expiry.
This commit is contained in:
@@ -42,13 +42,7 @@ const (
|
||||
)
|
||||
|
||||
// newJWT - returns new JWT object.
|
||||
func newJWT(expiry time.Duration) (*JWT, error) {
|
||||
if serverConfig == nil {
|
||||
return nil, errServerNotInitialized
|
||||
}
|
||||
|
||||
// Save access, secret keys.
|
||||
cred := serverConfig.GetCredential()
|
||||
func newJWT(expiry time.Duration, cred credential) (*JWT, error) {
|
||||
if !isValidAccessKey(cred.AccessKeyID) {
|
||||
return nil, errInvalidAccessKeyLength
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user