{"record":{"id":"d0c0120d43061034","repo":"ipfs/kubo","slug":"service-endpoint-should-be-provided-without-any-qu","errorCode":null,"errorMessage":"service endpoint should be provided without any query parameters","messagePattern":"service endpoint should be provided without any query parameters","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/pin/remotepin.go","lineNumber":806,"sourceCode":"\t\treturn \"\", \"\", err\n\t}\n\treturn endpoint, service.API.Key, nil\n}\n\nfunc normalizeEndpoint(endpoint string) (string, error) {\n\turi, err := neturl.ParseRequestURI(endpoint)\n\tif err != nil || !(uri.Scheme == \"http\" || uri.Scheme == \"https\") {\n\t\treturn \"\", fmt.Errorf(\"service endpoint must be a valid HTTP URL\")\n\t}\n\n\t// cleanup trailing and duplicate slashes (https://github.com/ipfs/kubo/issues/7826)\n\turi.Path = gopath.Clean(uri.Path)\n\turi.Path = strings.TrimSuffix(uri.Path, \".\")\n\turi.Path = strings.TrimSuffix(uri.Path, \"/\")\n\n\t// remove any query params\n\tif uri.RawQuery != \"\" {\n\t\treturn \"\", fmt.Errorf(\"service endpoint should be provided without any query parameters\")\n\t}\n\n\tif strings.HasSuffix(uri.Path, \"/pins\") {\n\t\treturn \"\", fmt.Errorf(\"service endpoint should be provided without the /pins suffix\")\n\t}\n\n\treturn uri.String(), nil\n}\n","sourceCodeStart":788,"sourceCodeEnd":815,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/pin/remotepin.go#L788-L815","documentation":"After parsing the endpoint, `normalizeEndpoint` rejects URLs that carry query parameters (anything after `?`). Pinning service endpoints must be a bare base URL because the client appends its own PSA API paths; a query string would corrupt the composed request URLs.","triggerScenarios":"Registering an endpoint like `https://api.example.com/psa?token=abc` or a URL copied from a browser address bar that included `?key=...` tracking/auth parameters.","commonSituations":"Users pasting URLs with API keys embedded as query params (an auth anti-pattern for PSA endpoints); browser-copied URLs with utm/track parameters; templated URLs that append `?format=json`.","solutions":["Remove the query string and register only the base path: `https://api.example.com/psa`.","Pass the API key via the dedicated mechanism instead (`--key=<apikey>` on `ipfs pin remote add`), not as a query parameter.","Check the pinning service's docs for its exact PSA base endpoint URL (typically ends before any `/pins` path).","If the service only authenticates via query string, that is unsupported by kubo's remote pinning — ask the provider for a header-based key."],"exampleFix":"// before\nipfs pin remote add svc https://api.example.com/psa?apikey=123 --key=$KEY\n// after\nipfs pin remote add svc https://api.example.com/psa --key=$KEY","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\nEP=\"$2\"\nif [[ \"$EP\" == *\\?* ]]; then\n  echo \"endpoint must not contain query parameters: ${EP%%\\?*}\" >&2\n  EP=\"${EP%%\\?*}\"\nfi\nipfs pin remote add \"$1\" \"$EP\" --key=\"$KEY\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Strip query strings from browser-copied URLs","Pass API keys via --key, never in the URL","Use the provider's documented base endpoint, not ad-hoc URLs"],"tags":["validation","url","remote-pinning","query-params"],"backgroundTag":"invalid-url","analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}