Skip to content

Commit c3e493b

Browse files
committed
Fixed the wrong HTTP Shema for API call
1 parent af95015 commit c3e493b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: src/Admin/Resources/templates/forms/api.html.twig

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<div class="card-content" x-data="checkApi">
2727
<div class="content" x-init="check">
2828
<div>
29-
<apan class="tag is-info">GET</apan> {{ app.request.getSchemeAndHttpHost() }}{{ path('public_api_form', { 'hash': formEntity.hash }) }}
29+
<apan class="tag is-info">GET</apan> {{ app.request.getHttpHost() }}{{ path('public_api_form', { 'hash': formEntity.hash }) }}
3030
</div>
3131
<div x-show="loading">
3232
<div class="mt-5 is-flex is-justify-content-center is-align-items-center">
@@ -40,7 +40,7 @@
4040
<pre x-text="getResponseExample"></pre>
4141
</div>
4242
<div class="mt-6">
43-
<apan class="tag is-success">POST</apan> {{ app.request.getSchemeAndHttpHost() }}{{ path('public_api_form', { 'hash': formEntity.hash }) }}
43+
<span class="tag is-success">POST</span> {{ app.request.getHttpHost() }}{{ path('public_api_form', { 'hash': formEntity.hash }) }}
4444
</div>
4545
<h6 class="mt-5">Body</h6>
4646
<div style="overflow-y: auto; max-height: 500px;">
@@ -60,7 +60,7 @@
6060
postRequestExample: '',
6161
6262
async check() {
63-
const response = await fetch('{{ app.request.getSchemeAndHttpHost() }}{{ path('public_api_form', { 'hash': formEntity.hash }) }}');
63+
const response = await fetch('//{{ app.request.getHttpHost() }}{{ path('public_api_form', { 'hash': formEntity.hash }) }}');
6464
this.response = await response.json();
6565
this.getResponseExample = JSON.stringify(this.response, null, 2);
6666
const postRequest = {};

0 commit comments

Comments
 (0)