GithubHelp home page GithubHelp logo

httpcommon.jl's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

httpcommon.jl's Issues

Dependency on Calendar creates ambiguity warnings with DataFrames package

julia> using DataFrames, HTTPCommon
Warning: New definition
    +(AbstractArray{T1<:Union(AbstractCalendarDuration,CalendarTime),N},AbstractArray{T2<:Union(AbstractCalendarDuration,CalendarTime),N}) at operators.jl:376
is ambiguous with:
    +(DataArray{T,N},AbstractArray{T,N}) at /Users/Administrator/.julia/v0.3/DataArrays/src/operators.jl:326.
To fix, define
    +(DataArray{T1<:Union(AbstractCalendarDuration,CalendarTime),N},AbstractArray{T2<:Union(AbstractCalendarDuration,CalendarTime),N})
before the new definition.
Warning: New definition
    +(AbstractArray{T1<:Union(AbstractCalendarDuration,CalendarTime),N},AbstractArray{T2<:Union(AbstractCalendarDuration,CalendarTime),N}) at operators.jl:376
is ambiguous with:
    +(AbstractDataArray{T,N},AbstractArray{T,N}) at /Users/Administrator/.julia/v0.3/DataArrays/src/operators.jl:350.
To fix, define
    +(AbstractDataArray{T1<:Union(AbstractCalendarDuration,CalendarTime),N},AbstractArray{T2<:Union(AbstractCalendarDuration,CalendarTime),N})
before the new definition.
Warning: New definition
    +(AbstractArray{T1<:Union(AbstractCalendarDuration,CalendarTime),N},AbstractArray{T2<:Union(AbstractCalendarDuration,CalendarTime),N}) at operators.jl:376
is ambiguous with:
    +(AbstractArray{T,N},DataArray{T,N}) at /Users/Administrator/.julia/v0.3/DataArrays/src/operators.jl:326.
To fix, define
    +(AbstractArray{T1<:Union(AbstractCalendarDuration,CalendarTime),N},DataArray{T2<:Union(AbstractCalendarDuration,CalendarTime),N})
before the new definition.
Warning: New definition
    +(AbstractArray{T1<:Union(AbstractCalendarDuration,CalendarTime),N},AbstractArray{T2<:Union(AbstractCalendarDuration,CalendarTime),N}) at operators.jl:376
is ambiguous with:
    +(AbstractArray{T,N},AbstractDataArray{T,N}) at /Users/Administrator/.julia/v0.3/DataArrays/src/operators.jl:350.
To fix, define
    +(AbstractArray{T1<:Union(AbstractCalendarDuration,CalendarTime),N},AbstractDataArray{T2<:Union(AbstractCalendarDuration,CalendarTime),N})
before the new definition.
Warning: New definition
    -(AbstractArray{T1<:Union(AbstractCalendarDuration,CalendarTime),N},AbstractArray{T2<:Union(AbstractCalendarDuration,CalendarTime),N}) at operators.jl:376
is ambiguous with:
    -(DataArray{T,N},AbstractArray{T,N}) at /Users/Administrator/.julia/v0.3/DataArrays/src/operators.jl:326.
To fix, define
    -(DataArray{T1<:Union(AbstractCalendarDuration,CalendarTime),N},AbstractArray{T2<:Union(AbstractCalendarDuration,CalendarTime),N})
before the new definition.
Warning: New definition
    -(AbstractArray{T1<:Union(AbstractCalendarDuration,CalendarTime),N},AbstractArray{T2<:Union(AbstractCalendarDuration,CalendarTime),N}) at operators.jl:376
is ambiguous with:
    -(AbstractArray{T,N},DataArray{T,N}) at /Users/Administrator/.julia/v0.3/DataArrays/src/operators.jl:326.
To fix, define
    -(AbstractArray{T1<:Union(AbstractCalendarDuration,CalendarTime),N},DataArray{T2<:Union(AbstractCalendarDuration,CalendarTime),N})
before the new definition.
Warning: New definition
    -(AbstractArray{T1<:Union(AbstractCalendarDuration,CalendarTime),N},AbstractArray{T2<:Union(AbstractCalendarDuration,CalendarTime),N}) at operators.jl:376
is ambiguous with:
    -(AbstractDataArray{T,N},AbstractArray{T,N}) at /Users/Administrator/.julia/v0.3/DataArrays/src/operators.jl:350.
To fix, define
    -(AbstractDataArray{T1<:Union(AbstractCalendarDuration,CalendarTime),N},AbstractArray{T2<:Union(AbstractCalendarDuration,CalendarTime),N})
before the new definition.
Warning: New definition
    -(AbstractArray{T1<:Union(AbstractCalendarDuration,CalendarTime),N},AbstractArray{T2<:Union(AbstractCalendarDuration,CalendarTime),N}) at operators.jl:376
is ambiguous with:
    -(AbstractArray{T,N},AbstractDataArray{T,N}) at /Users/Administrator/.julia/v0.3/DataArrays/src/operators.jl:350.
To fix, define
    -(AbstractArray{T1<:Union(AbstractCalendarDuration,CalendarTime),N},AbstractDataArray{T2<:Union(AbstractCalendarDuration,CalendarTime),N})
before the new definition.
Warning: New definition
    -(AbstractArray{T1<:CalendarTime,N},AbstractArray{T2<:CalendarTime,N}) at operators.jl:376
is ambiguous with:
    -(DataArray{T,N},AbstractArray{T,N}) at /Users/Administrator/.julia/v0.3/DataArrays/src/operators.jl:326.
To fix, define
    -(DataArray{T1<:CalendarTime,N},AbstractArray{T2<:CalendarTime,N})
before the new definition.
Warning: New definition
    -(AbstractArray{T1<:CalendarTime,N},AbstractArray{T2<:CalendarTime,N}) at operators.jl:376
is ambiguous with:
    -(AbstractArray{T,N},DataArray{T,N}) at /Users/Administrator/.julia/v0.3/DataArrays/src/operators.jl:326.
To fix, define
    -(AbstractArray{T1<:CalendarTime,N},DataArray{T2<:CalendarTime,N})
before the new definition.
Warning: New definition
    -(AbstractArray{T1<:CalendarTime,N},AbstractArray{T2<:CalendarTime,N}) at operators.jl:376
is ambiguous with:
    -(AbstractDataArray{T,N},AbstractArray{T,N}) at /Users/Administrator/.julia/v0.3/DataArrays/src/operators.jl:350.
To fix, define
    -(AbstractDataArray{T1<:CalendarTime,N},AbstractArray{T2<:CalendarTime,N})
before the new definition.
Warning: New definition
    -(AbstractArray{T1<:CalendarTime,N},AbstractArray{T2<:CalendarTime,N}) at operators.jl:376
is ambiguous with:
    -(AbstractArray{T,N},AbstractDataArray{T,N}) at /Users/Administrator/.julia/v0.3/DataArrays/src/operators.jl:350.
To fix, define
    -(AbstractArray{T1<:CalendarTime,N},AbstractDataArray{T2<:CalendarTime,N})
before the new definition.
Warning: requiring "HTTPCommon" did not define a corresponding module.

milktrader/Quandl.jl#43

Serve files in a streaming fashion

Currently, FileResponse() loads the entire file and then constructs and returns a Response instance. This gets put on the wire in HttpServer.write.

It would be better to have a streaming implementation of this. I would suggest

  1. Response gets a write function which simply outputs the Response.data
  2. FileResponse() only stores the data it needs to access the file
  3. Response/FileResponse.write() get called in HttpServer.write
  4. FileResponse.write reads from file and write to socket in a streaming fashion

It would not change the API, it would be a purely internal change.

Can I go ahead and work on a PR for this? Does anybody know of a good example for a good and solid (exception handling etc), Julianesque way of streaming read/write?

Thanks!

TypeError on package precompilation on master

Nightly coverage runs are dying with:

ERROR: LoadError: TypeError: in Type{...} expression, expected UnionAll, got typeof(Base.Nullable)
Stacktrace:
 [1] top-level scope
 [2] include at ./boot.jl:283 [inlined]
 [3] include_relative(::Module, ::String) at ./loading.jl:503
 [4] include(::Module, ::String) at ./sysimg.jl:15
 [5] top-level scope
 [6] eval at ./boot.jl:286 [inlined]
 [7] top-level scope at ./<missing>:2
in expression starting at /home/buildworker/.julia/v0.7/HttpCommon/src/HttpCommon.jl:65

@kshyatt just notifying you so you know what's up with coverage right now

Tag a new release

Dep warns have been eliminated for 0.6 would be good to get a release (last tag was May 16)

Currently broken on 0.7

The PR #47 merged today fails tests due to changes on nightly made since November. I'd submit a PR as a follow-up, but I unfortunately have an issue compiling 0.7 locally. The travis logs point to the two lines that need a change.

[PkgEval] HttpCommon may have a testing issue on Julia 0.4 (2014-08-16)

PackageEvaluator.jl is a script that runs nightly. It attempts to load all Julia packages and run their tests (if available) on both the stable version of Julia (0.3) and the nightly build of the unstable version (0.4). The results of this script are used to generate a package listing enhanced with testing results.

On Julia 0.4

  • On 2014-08-15 the testing status was Tests pass.
  • On 2014-08-16 the testing status changed to Package doesn't load.

Tests pass. means that PackageEvaluator found the tests for your package, executed them, and they all passed.

Package doesn't load. means that PackageEvaluator did not find tests for your package. Additionally, trying to load your package with using failed.

This issue was filed because your testing status became worse. No additional issues will be filed if your package remains in this state, and no issue will be filed if it improves. If you'd like to opt-out of these status-change messages, reply to this message saying you'd like to and @IainNZ will add an exception. If you'd like to discuss PackageEvaluator.jl please file an issue at the repository. For example, your package may be untestable on the test machine due to a dependency - an exception can be added.

Test log:

>>> 'Pkg.add("HttpCommon")' log
INFO: Installing BinDeps v0.3.0
INFO: Installing Calendar v0.4.2
INFO: Installing FactCheck v0.1.2
INFO: Installing HttpCommon v0.0.5
INFO: Installing ICU v0.4.1
INFO: Installing SHA v0.0.2
INFO: Installing URIParser v0.0.2
INFO: Building ICU
=================================[ ERROR: ICU ]=================================

None of the selected providers can install dependency icu.
Use BinDeps.debug(package_name) to see available providers

while loading /home/idunning/pkgtest/.julia/v0.4/ICU/deps/build.jl, in expression starting on line 28

================================================================================

================================[ BUILD ERRORS ]================================

WARNING: ICU had build errors.

 - packages with build errors remain installed in /home/idunning/pkgtest/.julia/v0.4
 - build a package and all its dependencies with `Pkg.build(pkg)`
 - build a single package by running its `deps/build.jl` script

================================================================================
INFO: Package database updated

>>> 'using HttpCommon' log
ERROR: could not open file /home/idunning/pkgtest/.julia/v0.4/ICU/src/../deps/deps.jl
 in include at ./boot.jl:245
 in include_from_node1 at ./loading.jl:128
 in include at ./boot.jl:245
 in include_from_node1 at ./loading.jl:128
 in reload_path at loading.jl:152
 in _require at loading.jl:67
 in require at loading.jl:54
 in include at ./boot.jl:245
 in include_from_node1 at ./loading.jl:128
 in reload_path at loading.jl:152
 in _require at loading.jl:67
 in require at loading.jl:54
 in include at ./boot.jl:245
 in include_from_node1 at ./loading.jl:128
 in reload_path at loading.jl:152
 in _require at loading.jl:67
 in require at loading.jl:51
 in include at ./boot.jl:245
 in include_from_node1 at loading.jl:128
 in process_options at ./client.jl:285
 in _start at ./client.jl:354
 in _start_3B_3500 at /home/idunning/julia04/usr/bin/../lib/julia/sys.so
while loading /home/idunning/pkgtest/.julia/v0.4/ICU/src/ICU.jl, in expression starting on line 54
while loading /home/idunning/pkgtest/.julia/v0.4/Calendar/src/Calendar.jl, in expression starting on line 1
while loading /home/idunning/pkgtest/.julia/v0.4/HttpCommon/src/HttpCommon.jl, in expression starting on line 3
while loading /home/idunning/pkgtest/.julia/v0.4/HttpCommon/testusing.jl, in expression starting on line 1


>>> test log
no tests to run
>>> end of log

why is headers() not exported?

The headers() function is used (internally to HttpCommon) for creating a default set of headers for an HTTP response.

headers() = (String => String)[ "Server" => "Julia/$VERSION",
                                "Content-Type" => "text/html; charset=utf-8",
                                "Content-Language" => "en",
                                "Date" => RFC1123_datetime()]

It is also useful externally whenever you'd like to see just one more header or change just one header, but don't really care about the rest. The place where I run into this is with setting the Content-Type (for js/css/etc files). All I need to to change the Content-Type, so I'd like to keep the other defaults. I realize that I can achieve this using HttpCommon.headers(), but I'm wondering if that's discouraged for any reason.

Is there a reason why it's not exported?

Port number missing from req.resource

Hi there,

Not sure if this issue belongs here but here it is:

In terminal A I have an app running on localhost with port 50000.
In terminal B I make a request to the app which (among other things) prints req.resource to STDOUT.
The printout ignores the port number.
When I parse req.resource through URIParser and print uri.port, the printed number is "0" rather than 50000. Am I missing something?

Cheers,
Jock

[PkgEval] HttpCommon may have a testing issue on Julia 0.3 (2014-08-16)

PackageEvaluator.jl is a script that runs nightly. It attempts to load all Julia packages and run their tests (if available) on both the stable version of Julia (0.3) and the nightly build of the unstable version (0.4). The results of this script are used to generate a package listing enhanced with testing results.

On Julia 0.3

  • On 2014-08-15 the testing status was Tests pass.
  • On 2014-08-16 the testing status changed to Package doesn't load.

Tests pass. means that PackageEvaluator found the tests for your package, executed them, and they all passed.

Package doesn't load. means that PackageEvaluator did not find tests for your package. Additionally, trying to load your package with using failed.

This issue was filed because your testing status became worse. No additional issues will be filed if your package remains in this state, and no issue will be filed if it improves. If you'd like to opt-out of these status-change messages, reply to this message saying you'd like to and @IainNZ will add an exception. If you'd like to discuss PackageEvaluator.jl please file an issue at the repository. For example, your package may be untestable on the test machine due to a dependency - an exception can be added.

Test log:

>>> 'Pkg.add("HttpCommon")' log
INFO: Installing BinDeps v0.3.0
INFO: Installing Calendar v0.4.2
INFO: Installing FactCheck v0.1.2
INFO: Installing HttpCommon v0.0.5
INFO: Installing ICU v0.4.1
INFO: Installing SHA v0.0.2
INFO: Installing URIParser v0.0.2
INFO: Building ICU
=================================[ ERROR: ICU ]=================================

None of the selected providers can install dependency icu.
Use BinDeps.debug(package_name) to see available providers

while loading /home/idunning/pkgtest/.julia/v0.3/ICU/deps/build.jl, in expression starting on line 28

================================================================================

================================[ BUILD ERRORS ]================================

WARNING: ICU had build errors.

 - packages with build errors remain installed in /home/idunning/pkgtest/.julia/v0.3
 - build a package and all its dependencies with `Pkg.build(pkg)`
 - build a single package by running its `deps/build.jl` script

================================================================================
INFO: Package database updated
INFO: METADATA is out-of-date a you may not have the latest version of HttpCommon
INFO: Use `Pkg.update()` to get the latest versions of your packages

>>> 'using HttpCommon' log
ERROR: could not open file /home/idunning/pkgtest/.julia/v0.3/ICU/src/../deps/deps.jl
 in include at ./boot.jl:245
 in include_from_node1 at ./loading.jl:128
 in include at ./boot.jl:245
 in include_from_node1 at ./loading.jl:128
 in reload_path at loading.jl:152
 in _require at loading.jl:67
 in require at loading.jl:54
 in include at ./boot.jl:245
 in include_from_node1 at ./loading.jl:128
 in reload_path at loading.jl:152
 in _require at loading.jl:67
 in require at loading.jl:54
 in include at ./boot.jl:245
 in include_from_node1 at ./loading.jl:128
 in reload_path at loading.jl:152
 in _require at loading.jl:67
 in require at loading.jl:51
 in include at ./boot.jl:245
 in include_from_node1 at loading.jl:128
 in process_options at ./client.jl:285
 in _start at ./client.jl:354
 in _start_3B_1699 at /home/idunning/julia03/usr/bin/../lib/julia/sys.so
while loading /home/idunning/pkgtest/.julia/v0.3/ICU/src/ICU.jl, in expression starting on line 54
while loading /home/idunning/pkgtest/.julia/v0.3/Calendar/src/Calendar.jl, in expression starting on line 1
while loading /home/idunning/pkgtest/.julia/v0.3/HttpCommon/src/HttpCommon.jl, in expression starting on line 3
while loading /home/idunning/pkgtest/.julia/v0.3/HttpCommon/testusing.jl, in expression starting on line 1


>>> test log
no tests to run
>>> end of log

Unable to read File Stream from req.data

I have implemented file upload control in html file and submitted form with data as multipart/form-data.

I want to read file stream from http request and save it into a file on server. Please help me if any body have solution.

decodeURI is creating null bytes

Here's a simple test case (using Morsel):

using Morsel
using HttpServer.parsequerystring
app = Morsel.app()

post(app, "/proc") do req, res
    println(parsequerystring(req.http_req.data))
    "Result $(parsequerystring(req.http_req.data)) !"
end
start(app, 8000)

Then run:

curl -POST 'http://localhost:8000/proc' -d "name=Jim"

Result on my machine (Mac OS X Mavericks, Julia 0.3.0) is:
Result ["name"=>"Jim\b\0\0\0\0\0\0\0"] !

Deprecation warnings

WARNING: deprecated syntax "{a=>b, ...}" at /Users/Administrator/.julia/v0.4/HttpCommon/src/HttpCommon.jl:93.
Use "Dict{Any,Any}(a=>b, ...)" instead.

WARNING: deprecated syntax "[a=>b, ...]" at /Users/Administrator/.julia/v0.4/HttpCommon/src/HttpCommon.jl:109.
Use "Dict(a=>b, ...)" instead.

WARNING: deprecated syntax "(String=>HttpMethodBitmask)[a=>b, ...]" at /Users/Administrator/.julia/v0.4/HttpCommon/src/HttpCommon.jl:116.
Use "Dict{String,HttpMethodBitmask}(a=>b, ...)" instead.

WARNING: deprecated syntax "[a=>b, ...]" at /Users/Administrator/.julia/v0.4/HttpCommon/src/HttpCommon.jl:136.
Use "Dict(a=>b, ...)" instead.

WARNING: deprecated syntax "(String=>String)[a=>b, ...]" at /Users/Administrator/.julia/v0.4/HttpCommon/src/HttpCommon.jl:139.
Use "Dict{String,String}(a=>b, ...)" instead.

WARNING: deprecated syntax "(String=>String)[]" at /Users/Administrator/.julia/v0.4/HttpCommon/src/HttpCommon.jl:155.
Use "Dict{String,String}()" instead.

WARNING: deprecated syntax "{a,b, ...}" at /Users/Administrator/.julia/v0.4/HttpCommon/src/HttpCommon.jl:196.
Use "Any[a,b, ...]" instead.

WARNING: deprecated syntax "{a,b, ...}" at /Users/Administrator/.julia/v0.4/HttpCommon/src/HttpCommon.jl:196.
Use "Any[a,b, ...]" instead.

WARNING: deprecated syntax "{a=>b, ...}" at /Users/Administrator/.julia/v0.4/HttpCommon/src/mimetypes.jl:981.
Use "Dict{Any,Any}(a=>b, ...)" instead.

milktrader/Quandl.jl#61

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.