Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

fix(demarches-simplifies): check if url exists via HEAD request #252

Merged
merged 5 commits into from
Sep 27, 2022

Conversation

rap2hpoutre
Copy link
Member

@rap2hpoutre rap2hpoutre commented Sep 22, 2022

Ça a l'air de marcher :)

@rap2hpoutre rap2hpoutre self-assigned this Sep 22, 2022
@github-actions github-actions bot temporarily deployed to mon-psy-sante-validate-dossier-url September 22, 2022 13:01 Inactive
@rap2hpoutre rap2hpoutre changed the title fix(demarches-simplifies): check url with url-exist fix(demarches-simplifies): check url Sep 22, 2022
@github-actions github-actions bot temporarily deployed to mon-psy-sante-validate-dossier-url September 22, 2022 15:28 Inactive
@github-actions github-actions bot temporarily deployed to mon-psy-sante-validate-dossier-url September 23, 2022 09:04 Inactive
@github-actions github-actions bot temporarily deployed to mon-psy-sante-validate-dossier-url September 23, 2022 11:56 Inactive
@@ -159,37 +158,4 @@ describe("validatePsychologist", () => {
candidateIsNotAPsychologistMessage("73")
);
});

it("should fail when website is wrong", () => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai enlevé le test car la validation ne se trouve plus au même endroit et n'est donc plus gérée par zod via validatePsychologist

@rap2hpoutre rap2hpoutre changed the title fix(demarches-simplifies): check url fix(demarches-simplifies): check if url exists via HEAD request Sep 23, 2022
};

const req = http.request(options, (res) => {
resolve(res.statusCode < 400 || res.statusCode >= 500);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

si c'est >= 500 c'est valide ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Euh oui, j'avais copié/collé mais ça me parait bizarre. J'imagine que c'était pour dire "si le site fait une erreur 500, il existe et il répond, il est juste planté", mais dans notre cas ça n'a pas d'intérêt. J'ai changé pour accepter seulement en dessous de 400.

Copy link
Contributor

@carolineBda carolineBda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@sonarcloud
Copy link

sonarcloud bot commented Sep 27, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@rap2hpoutre rap2hpoutre merged commit 14fbc8f into main Sep 27, 2022
@rap2hpoutre rap2hpoutre deleted the validate-dossier-url branch September 27, 2022 07:53
SocialGroovyBot added a commit that referenced this pull request Sep 27, 2022
## [1.56.1](v1.56.0...v1.56.1) (2022-09-27)

### Bug Fixes

* **demarches-simplifies:** check if url exists via HEAD request ([#252](#252)) ([14fbc8f](14fbc8f))
@SocialGroovyBot
Copy link
Member

🎉 This PR is included in version 1.56.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants