Qqwy

Qqwy

TypeCheck Core Team

Cowboy + Hound + PhantomJS problems

I am working on setting up integration testing of our Phoenix-application using Hound. I encountered a very strange error, which is that when using PhantomJS as Hound browser driver, Cowboy will reject all incoming connection with an ‘error 400’.

Searching the internet I found out that other people had a similar problem with Cowboy as well: PhantomJS does not by default seem to add a Host:-header to the requests it does, which is against the HTTP spec and rejected by Cowboy (as well as happily accepted by most other webservers).

Switching to Selenium+Firefox instead of PhantomJS and everything works fine.
So just a heads-up that this issue exists. I’m not sure how this could/should be resolved; what would be the best approach?

  • Ask the developers of PhantomJS to alter its default settings so it follows the spec.
  • Update Hound so it requests PhantomJS to set a Host:-header when connecting.
  • Update Hound so it has the possibility to add custom HTTP headers from your own code.
  • Ask the people behind Cowboy to create a way to accept requests with missing Host:-headers.

Most Liked

idi527

idi527

I think it might be easier to switch to chrome. I’m not sure if there’s anyone left to develop phantomjs further at this point: Redirecting to Google Groups.

I mostly use GitHub - puppeteer/puppeteer: JavaScript API for Chrome and Firefox · GitHub for “end-to-end” tests.

Where Next?

Popular in Questions Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43757 214
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement