Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure PDNS_Url has no trailing slash ('/'). #6171

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

diffway
Copy link

@diffway diffway commented Dec 24, 2024

The code with trailing slash

# export PDNS_Url='http://127.1.1.53:8081/'
# curl -v -H "X-API-Key: ${PDNS_API_KEY}" ${PDNS_API_URL}/api/v1/servers/localhost/zones |jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 127.1.1.53:8081...
* Connected to 127.1.1.53 (127.1.1.53) port 8081 (#0)
> GET //api/v1/servers/localhost/zones HTTP/1.1
> Host: 127.1.1.53:8081
> User-Agent: curl/7.88.1
> Accept: */*
> X-API-Key: <redacted>
>
< HTTP/1.1 404 Not Found
< Connection: close
< Content-Length: 9
< Content-Type: text/plain; charset=utf-8
<
{ [9 bytes data]
100     9  100     9    0     0    553      0 --:--:-- --:--:-- --:--:--   562
* Closing connection 0
parse error: Invalid numeric literal at line 1, column 4
#

The same code without trailing slash

# export PDNS_Url='http://127.1.1.53:8081'
# curl -v -H "X-API-Key: ${PDNS_API_KEY}" ${PDNS_API_URL}/api/v1/servers/localhost/zones |jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 127.1.1.53:8081...
* Connected to 127.1.1.53 (127.1.1.53) port 8081 (#0)
> GET /api/v1/servers/localhost/zones HTTP/1.1
> Host: 127.1.1.53:8081
> User-Agent: curl/7.88.1
> Accept: */*
> X-API-Key: <redacted>
>
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Connection: close
< Content-Length: 290
< Content-Security-Policy: default-src 'self'; style-src 'self' 'unsafe-inline'
< Content-Type: application/json
< X-Content-Type-Options: nosniff
< X-Frame-Options: deny
< X-Permitted-Cross-Domain-Policies: none
< X-Xss-Protection: 1; mode=block
<
{ [290 bytes data]
100   290  100   290    0     0  14788      0 --:--:-- --:--:-- --:--:-- 15263
* Closing connection 0
[
  {
    "account": "",
    "catalog": "",
    "dnssec": true,
    "edited_serial": 2024122408,
    "id": "<redacted>.",
    "kind": "Native",
    "last_check": 0,
    "masters": [],
    "name": "<redacted>.",
    "notified_serial": 2024122408,
    "serial": 2024122408,
    "url": "/api/v1/servers/localhost/zones/<redacted>."
  }
]
#

debug-staging-issue-error.txt
debug-staging-issue-success-but-failed-to-remove.txt

Copy link

Welcome
First thing: don't send PR to the master branch, please send to the dev branch instead.
Please make sure you've read our DNS API Dev Guide and DNS-API-Test.
Then reply on this message, otherwise, your code will not be reviewed or merged.
Please also make sure to add/update the usage here: https://github.com/acmesh-official/acme.sh/wiki/dnsapi2
We look forward to reviewing your Pull request shortly ✨
注意: 必须通过了 DNS-API-Test 才会被 review. 无论是修改, 还是新加的 dns api, 都必须确保通过这个测试.

@diffway diffway changed the title 2024-12-24 - Ensure that $PDNS_Url has no trailing slash ('/'). Ensure that PDNS_Url has no trailing slash ('/'). Dec 24, 2024
@diffway diffway changed the title Ensure that PDNS_Url has no trailing slash ('/'). Ensure PDNS_Url has no trailing slash ('/'). Dec 24, 2024
@Neilpang
Copy link
Member

@diffway diffway force-pushed the feature_dnsapi_dns_pdns_ltrim_the_slash branch from b6b1b16 to ac21299 Compare December 27, 2024 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants