Skip to content

/suggest/series_country: returns an empty response when there is no suggestion #630

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

Closed
php-coder opened this issue Aug 29, 2017 · 9 comments
Assignees
Labels
Milestone

Comments

@php-coder
Copy link
Owner

php-coder commented Aug 29, 2017

When as admin I open /series/add page in Firefox, I see the following error in the developer console:

Ошибка синтаксического анализа XML: корневой элемент не найден
Адрес: http://localhost:8080/suggest/series_country
Строка 1, символ 1:

It turned out that /suggest/series_country returns an empty response. I see that also when I'm getting the response from the terminal:

$ http 'http://localhost:8080/suggest/series_country' Cookie:JSESSIONID=dyhl9vt2dr9g126hsqu0b0ict
HTTP/1.1 200 OK
Content-Length: 0
Date: Tue, 29 Aug 2017 20:43:54 GMT

Here the similar problem on StackOverflow: https://stackoverflow.com/questions/25650356/spring-ajax-responsebody-with-null-returned-values

Based on one of the answers, I think that we should try to return 204 No Content code and handle it accordingly on the client side.

@Shkarin JFYI

@php-coder php-coder added this to the next milestone Aug 29, 2017
@php-coder
Copy link
Owner Author

I also was surprised that the response doesn't have Content-Type header. I think that we should add it.

@php-coder
Copy link
Owner Author

My current idea is to return an empty string when we can't suggest anything.

@Shkarin
Copy link
Contributor

Shkarin commented Sep 24, 2017 via email

@Shkarin
Copy link
Contributor

Shkarin commented Sep 24, 2017 via email

@php-coder
Copy link
Owner Author

Нет по обоим вопросам. Назначь на себя и добавь метку in-progress, если хочешь ими заняться.

@Shkarin
Copy link
Contributor

Shkarin commented Sep 24, 2017 via email

@Shkarin
Copy link
Contributor

Shkarin commented Sep 24, 2017 via email

@php-coder
Copy link
Owner Author

Может я ошибаюсь, но вроде тесты уже на все есть, разве нет?

This issue is about integration tests (that are using Selenium) and we only have unit tests right now.

And BTW it's better to discuss the issue in the comments to this issues.

@php-coder
Copy link
Owner Author

http://prntscr.com/gp61g1 может тут проверку сделаем на нул и будем возвращать пустую строку?

Yes, let's try this.

@Shkarin Shkarin self-assigned this Sep 24, 2017
@php-coder php-coder assigned php-coder and unassigned Shkarin Dec 14, 2018
@php-coder php-coder modified the milestones: next, 0.4 Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants