Skip to content

Commit

Permalink
fix: Get host for curl usage example (#5405)
Browse files Browse the repository at this point in the history
  • Loading branch information
triklozoid committed Jun 11, 2024
1 parent 929b202 commit 20bb8f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions label_studio/users/templates/users/user_account.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
{% if settings.HOSTNAME %}
curl -X GET {{ settings.HOSTNAME }}/api/projects/ -H 'Authorization: Token {{token}}'
{% else %}
curl -X GET http://localhost:8080/api/projects/ -H 'Authorization: Token {{token}}'
curl -X GET {{ request.scheme }}://{{ request.get_host }}/api/projects/ -H 'Authorization: Token {{token}}'
{% endif %}
</textarea>
<p class="actions">
Expand Down Expand Up @@ -184,7 +184,7 @@
{% if settings.HOSTNAME %}
const hostname = '{{ settings.HOSTNAME }}';
{% else %}
const hostname = 'http://localhost:8080';
const hostname = '{{ request.scheme }}://{{ request.get_host }}';
{% endif %}

document.querySelectorAll('[data-copy]').forEach(button => {
Expand Down

0 comments on commit 20bb8f0

Please sign in to comment.