(endpoint)
| 454 | } |
| 455 | |
| 456 | function normalizeEndpoint(endpoint) { |
| 457 | const value = endpoint.startsWith("http://") || endpoint.startsWith("https://") |
| 458 | ? endpoint |
| 459 | : `https://${endpoint}`; |
| 460 | const parsed = new URL(value); |
| 461 | return { |
| 462 | protocol: parsed.protocol, |
| 463 | hostname: parsed.hostname, |
| 464 | }; |
| 465 | } |
| 466 | |
| 467 | function ossAuthorization(options) { |
| 468 | const canonicalizedResource = `/${options.bucket}/${options.objectKey}`; |