Skip to content

Commit

Permalink
fix: treat HAL-FORMS document without _templates as HAL document
Browse files Browse the repository at this point in the history
fixes #124
  • Loading branch information
toedter committed Sep 18, 2024
1 parent bf75582 commit f7cc755
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/response-explorer/response-explorer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ export class ResponseExplorerComponent implements OnInit {
this.responseUrl = httpResponse.url;
this.isHalFormsMediaType = false;
const contentType = httpResponse.headers.get('content-type');
if (contentType?.startsWith('application/prs.hal-forms+json')
|| this.responseUrl?.endsWith('.hal-forms.json')) {
if ((contentType?.startsWith('application/prs.hal-forms+json') && httpResponse?.body?._templates)
|| (this.responseUrl?.endsWith('.hal-forms.json') && httpResponse?.body?._templates)) {
this.isHalFormsMediaType = true;
}
if (!(typeof httpResponse.body === 'string' || httpResponse.body instanceof String)) {
Expand Down

0 comments on commit f7cc755

Please sign in to comment.