cessda / cessda.cvs.two

Apache License 2.0
0 stars 2 forks source link

Wrong Http Response for CVs not found #415

Closed cessda-bitbucket-importer closed 1 year ago

cessda-bitbucket-importer commented 2 years ago

Original report on BitBucket by Joshua Tetteh Ocansey (GitHub: Joshocan).


Joshuas-iMac:~ Joshocan$ curl -I  https://vocabularies.cessda.eu/vocabulary/CdcPublisherNams?v=5.0
HTTP/2 200 
expires: 0
cache-control: no-cache, no-store, max-age=0, must-revalidate
pragma: no-cache
referrer-policy: strict-origin-when-cross-origin
accept-ranges: bytes
content-security-policy: default-src 'self' https://cdn.matomo.cloud https://cessda.matomo.cloud https://analytics.cessda.eu; frame-src 'self' https://cdn.matomo.cloud https://cessda.matomo.cloud https://cessda.atlassian.net data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.matomo.cloud https://cessda.matomo.cloud https://cessda.atlassian.net https://analytics.cessda.eu https://storage.googleapis.com; style-src 'self' https://fonts.googleapis.com 'unsafe-inline'; img-src 'self' https://cdn.matomo.cloud https://cessda.matomo.cloud https://cessda.atlassian.net https://analytics.cessda.eu data:; font-src 'self' https://fonts.gstatic.com data:
date: Wed, 14 Sep 2022 08:51:12 GMT
content-language: en-US
vary: Origin
vary: Access-Control-Request-Method
vary: Access-Control-Request-Headers
last-modified: Thu, 01 Jan 1970 00:00:01 GMT
feature-policy: geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera 'none'; magnetometer 'none'; gyroscope 'none'; speaker 'none'; fullscreen 'self'; payment 'none'
content-length: 3798
content-type: text/html
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
x-frame-options: sameorigin
x-xss-protection: 1

It should rather respond with 404 with a message as :

Http/2 404

CV with object CdcPublisherNams?v=5.0 not found

cessda-bitbucket-importer commented 2 years ago

Original comment by Taina Jääskeläinen.


Currently shows the user empty page, should give a response.

cessda-bitbucket-importer commented 1 year ago

Original comment by Martin Šeleng (GitHub: pakoselo).


@Joshocan Actually it returns the 500 error, but it doesn’t show the error in the browser. The 200 is only for the page showed. I am not able to see the image, but probably is the same as mine.

cessda-bitbucket-importer commented 1 year ago

Original comment by Martin Šeleng (GitHub: pakoselo).


@Joshocan Finally I was able to open it and is the same.

cessda-bitbucket-importer commented 1 year ago

Original comment by Joshua Tetteh Ocansey (GitHub: Joshocan).


@pakoselo Thanks for working on this. It should not respond with 500 code for unknown CV.

it should rather return 404 code with a caption “ CV with object ${CV_name} not found” both at the machine interface and User interface.

Do you want me to split issues into two; one for machine response and other for UI response? If you like

cessda-bitbucket-importer commented 1 year ago

Original comment by Martin Šeleng (GitHub: pakoselo).


@Joshocan the problem is how the whole application is developed and it needs to redesign lot of stuff, so leave it as it is right now.

cessda-bitbucket-importer commented 1 year ago

Original comment by Martin Šeleng (GitHub: pakoselo).


@Joshocan I found the solution, it is little bit weird, but efficient. Marked as resolved.

cessda-bitbucket-importer commented 1 year ago

Original comment by Joshua Tetteh Ocansey (GitHub: Joshocan).


Thanks @pakoselo Has it changes being committed yet so I can test it?

cessda-bitbucket-importer commented 1 year ago

Original comment by Martin Šeleng (GitHub: pakoselo).


Not yet, as the build was not running. And yet it produces test errors. Need to update tests.

cessda-bitbucket-importer commented 1 year ago

Original comment by Martin Šeleng (GitHub: pakoselo).


@Joshocan It should be on staging already as the builds of the master branch were successful + you can also test issue 414. I need to redesign them little bit to be more spring oriented, but it’s ok right now.

cessda-bitbucket-importer commented 1 year ago

Original comment by Joshua Tetteh Ocansey (GitHub: Joshocan).


Thanks @pakoselo

Yes, I tested it .

  1. It works well and as expected on the UI (find below)

2. But the issue persists in the machine readable level, it still returns 200 code (see below)

cessda-bitbucket-importer commented 1 year ago

Original comment by Martin Šeleng (GitHub: pakoselo).


Probably it will take more time as I didn't saw the way, how to generate an error, in every error the system generates ok I don’t see it as a problem right now.

cessda-bitbucket-importer commented 1 year ago

Original comment by Joshua Tetteh Ocansey (GitHub: Joshocan).


@pakoselo In that case, I will separate the issues and close this issue for UI

cessda-bitbucket-importer commented 1 year ago

Original comment by Martin Šeleng (GitHub: pakoselo).


@Joshocan you got the curl message wrong. The reason why the result is 200 is, that it returns the webpage with the error message and the status must be 200. Because the webpage is displayed correctly. You will get the error only, when you don't implement the 404 page at your site (e.g. https://chess.sk/dsafadsf). But we are displaying the menu and everything correctly, only informing the user about the error.