Skip to content

fixing bug 812#823

Merged
jbenet merged 2 commits intoipfs:masterfrom
BrendanBenshoof:master
Mar 3, 2015
Merged

fixing bug 812#823
jbenet merged 2 commits intoipfs:masterfrom
BrendanBenshoof:master

Conversation

@BrendanBenshoof
Copy link
Copy Markdown

hopefully I finally got this right
bug #812

@jbenet
Copy link
Copy Markdown
Member

jbenet commented Feb 25, 2015

@BrendanBenshoof I think we want both:

mux.Handle("/"+path+"/", handler)
mux.Handle("/"+path, handler)

not all browsers redirect correctly (curl)

@BrendanBenshoof
Copy link
Copy Markdown
Author

We already went through that.
see pull request #816 (closed) #816

@jbenet
Copy link
Copy Markdown
Member

jbenet commented Feb 26, 2015

Ah, ok! great then.

@jbenet
Copy link
Copy Markdown
Member

jbenet commented Feb 26, 2015

I think this needs to be in a sharness test to makes sure it doesn't regress.

@BrendanBenshoof take a look at test/sharenss/t0110-gateway.sh -- if you feel comfortable writing one of those great, else I can do it.

@BrendanBenshoof BrendanBenshoof force-pushed the master branch 2 times, most recently from 93c3e73 to feaf10d Compare February 27, 2015 22:37
@BrendanBenshoof
Copy link
Copy Markdown
Author

@jbenet Test is added

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This will need updating whenever a new version of WebUI is pushed

@BrendanBenshoof
Copy link
Copy Markdown
Author

I am getting different behavior on my node versus the Travis CI (see #840 ) and I relaxed the test to allow for it.

I currently test:
does node:5001/webui and node:5001/webui/ return either code 302 or 301

I should also test:
does node:5001/ipfs/correcthash return 404 (when lookup fails)
does node:5001/ipfs/wronghash return 403
But I think those test should be part of addressing #840

expected Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

these files shouldnt be here i dont think

@whyrusleeping
Copy link
Copy Markdown
Member

remove weird files in root and LGTM

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hrm... now that i think about it, lets work on breaking this up into a few smaller test. do each curl in one, make sure it succeeds, do the text comparisons in their own functions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 on smaller tests

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

How about 2 tests:
Files actually download and
Codes match expected values

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe also divide by webui and webui/ (may be easier to read/edit as two semi identical blocks)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

needs && at end of each line.

@BrendanBenshoof
Copy link
Copy Markdown
Author

Ok, I broke into two test that share some state.

@jbenet
Copy link
Copy Markdown
Member

jbenet commented Mar 2, 2015

LGTM!

jbenet added a commit that referenced this pull request Mar 3, 2015
@jbenet jbenet merged commit 9f27556 into ipfs:master Mar 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants